From a29c4509a316c0c77450b6fa74b96f036b0f0821 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 23 Dec 2025 09:59:50 +0100 Subject: Add structure --- tests/scorecounter.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/scorecounter.py (limited to 'tests/scorecounter.py') diff --git a/tests/scorecounter.py b/tests/scorecounter.py new file mode 100644 index 0000000..d59e9f3 --- /dev/null +++ b/tests/scorecounter.py @@ -0,0 +1,35 @@ +import os +import sys +import tempfile +from pathlib import Path + +import pytest + + +def run_tests(): + project_path = Path(__file__).parent.parent + os.chdir(project_path) + + # Determine any args to pass to pytest. If there aren't any, + # default to running the whole test suite. + args = sys.argv[1:] + if len(args) == 0: + args = ["tests"] + + returncode = pytest.main( + [ + # Turn up verbosity + "-vv", + # Disable color + "--color=no", + # Overwrite the cache directory to somewhere writable + "-o", + f"cache_dir={tempfile.gettempdir()}/.pytest_cache", + ] + args + ) + + print(f">>>>>>>>>> EXIT {returncode} <<<<<<<<<<") + + +if __name__ == "__main__": + run_tests() -- cgit v1.3