summaryrefslogtreecommitdiff
path: root/tests/scorecounter.py
diff options
context:
space:
mode:
authorSimeon Simeonov2025-12-23 09:59:50 +0100
committerSimeon Simeonov2025-12-23 09:59:50 +0100
commita29c4509a316c0c77450b6fa74b96f036b0f0821 (patch)
tree13babfe7a0fba24c7df609c909b81ab70f4092ec /tests/scorecounter.py
parent8ad11db860898dcfc9269f2b84df7e301a6e8e5c (diff)
Add structure
Diffstat (limited to 'tests/scorecounter.py')
-rw-r--r--tests/scorecounter.py35
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 @@
1import os
2import sys
3import tempfile
4from pathlib import Path
5
6import pytest
7
8
9def 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
34if __name__ == "__main__":
35 run_tests()