Files
TimeTracker/scripts/run_model_tests.py
T
Dries Peeters 64b5fbe45d chore: move scripts to scripts/
- Move Python and shell scripts (apply_migration, check_routes, run_tests, etc.) to scripts/
- Move setup-https-mkcert and start-https (bat/sh) to scripts/
- Update start-local-test.bat and start-local-test.sh
2026-03-15 10:16:22 +01:00

27 lines
777 B
Python

#!/usr/bin/env python
"""Simple test runner to check model tests. Run from project root: python scripts/run_model_tests.py"""
import os
import subprocess
import sys
# Run from project root (parent of scripts/)
_script_dir = os.path.dirname(os.path.abspath(__file__))
_project_root = os.path.dirname(_script_dir)
os.chdir(_project_root)
result = subprocess.run(
[sys.executable, "-m", "pytest", "-m", "unit and models", "-v", "--tb=short"],
capture_output=True,
text=True
)
with open("test_results_model.txt", "w", encoding="utf-8") as f:
f.write(result.stdout)
f.write("\n")
f.write(result.stderr)
f.write(f"\n\nExit code: {result.returncode}\n")
print("Test results written to test_results_model.txt")
print(f"Exit code: {result.returncode}")