Added pyrate as a direct dependency.
This commit is contained in:
33
pyrate/tests/test_the_scripts.py
Normal file
33
pyrate/tests/test_the_scripts.py
Normal 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,
|
||||
)
|
Reference in New Issue
Block a user