diff options
| author | Simeon Simeonov | 2025-12-23 09:59:50 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2025-12-23 09:59:50 +0100 |
| commit | a29c4509a316c0c77450b6fa74b96f036b0f0821 (patch) | |
| tree | 13babfe7a0fba24c7df609c909b81ab70f4092ec /tests/scorecounter.py | |
| parent | 8ad11db860898dcfc9269f2b84df7e301a6e8e5c (diff) | |
Add structure
Diffstat (limited to 'tests/scorecounter.py')
| -rw-r--r-- | tests/scorecounter.py | 35 |
1 files changed, 35 insertions, 0 deletions
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 @@ | |||
| 1 | import os | ||
| 2 | import sys | ||
| 3 | import tempfile | ||
| 4 | from pathlib import Path | ||
| 5 | |||
| 6 | import pytest | ||
| 7 | |||
| 8 | |||
| 9 | def run_tests(): | ||
| 10 | project_path = Path(__file__).parent.parent | ||
| 11 | os.chdir(project_path) | ||
| 12 | |||
| 13 | # Determine any args to pass to pytest. If there aren't any, | ||
| 14 | # default to running the whole test suite. | ||
| 15 | args = sys.argv[1:] | ||
| 16 | if len(args) == 0: | ||
| 17 | args = ["tests"] | ||
| 18 | |||
| 19 | returncode = pytest.main( | ||
| 20 | [ | ||
| 21 | # Turn up verbosity | ||
| 22 | "-vv", | ||
| 23 | # Disable color | ||
| 24 | "--color=no", | ||
| 25 | # Overwrite the cache directory to somewhere writable | ||
| 26 | "-o", | ||
| 27 | f"cache_dir={tempfile.gettempdir()}/.pytest_cache", | ||
| 28 | ] + args | ||
| 29 | ) | ||
| 30 | |||
| 31 | print(f">>>>>>>>>> EXIT {returncode} <<<<<<<<<<") | ||
| 32 | |||
| 33 | |||
| 34 | if __name__ == "__main__": | ||
| 35 | run_tests() | ||
