1
0

Added pyrate as a direct dependency.

This commit is contained in:
2022-07-11 23:07:33 +02:00
parent 8c4532dad4
commit c99d517f6f
230 changed files with 21114 additions and 0 deletions

View File

@ -0,0 +1,33 @@
"""Tests the bundled scripts."""
# Standard library
from pathlib import Path
from subprocess import run
import sys
# Typing
from typing import Set
# Generic testing
from unittest import TestCase
class TestScripts(TestCase):
"""Tests ``pyrate/scripts/*``."""
BASE_DIR = Path(__file__).parent.parent / "scripts"
EXCLUDE: Set[Path] = set()
def test_invoke_help(self) -> None:
"""Tests that the help can be invoked, which makes sure that at least all imports work."""
for script in set(TestScripts.BASE_DIR.iterdir()) - TestScripts.EXCLUDE:
if not script.name.startswith(".") and not script.name.startswith("__"):
with self.subTest(script.name):
run(
[sys.executable, str(script), "--help"],
capture_output=True,
timeout=30, # Sometimes caches are generated, so this is a long timeout
text=True,
check=True,
)