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/__init__.py | 0 tests/scorecounter.py | 35 +++++++++++++++++++++++++++++++++++ tests/test_app.py | 3 +++ 3 files changed, 38 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/scorecounter.py create mode 100644 tests/test_app.py (limited to 'tests') diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 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() diff --git a/tests/test_app.py b/tests/test_app.py new file mode 100644 index 0000000..e1a335f --- /dev/null +++ b/tests/test_app.py @@ -0,0 +1,3 @@ +def test_first(): + """An initial test for the app.""" + assert 1 + 1 == 2 -- cgit v1.3