test: define hardened Compose contract

This commit is contained in:
BirSite Automation
2026-07-19 17:28:59 +00:00
parent 49156f1488
commit f94407e587
2 changed files with 223 additions and 0 deletions

20
tests/run.py Normal file
View File

@@ -0,0 +1,20 @@
"""Compile the contract tests, then execute unittest discovery."""
from pathlib import Path
import py_compile
import sys
import unittest
TEST_DIR = Path(__file__).resolve().parent
def main() -> int:
for test_file in sorted(TEST_DIR.glob("test_*.py")):
py_compile.compile(str(test_file), doraise=True)
suite = unittest.defaultTestLoader.discover(str(TEST_DIR), pattern="test_*.py")
return 0 if unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful() else 1
if __name__ == "__main__":
sys.exit(main())