test/run_all.py
raw| 1 | #!/usr/bin/env python |
| 2 | |
| 3 | """ |
| 4 | Main test function to execute all tests found in the current directory |
| 5 | """ |
| 6 | |
| 7 | from pathlib import Path |
| 8 | import sys |
| 9 | import unittest |
| 10 | |
| 11 | import xmlrunner |
| 12 | |
| 13 | |
| 14 | def main() -> bool: |
| 15 | tests = unittest.TestLoader().discover(".", "test_*.py") |
| 16 | testResult = xmlrunner.XMLTestRunner(output=str(Path(".").resolve() / "test-reports")).run(tests) |
| 17 | |
| 18 | return not testResult.wasSuccessful() |
| 19 | |
| 20 | |
| 21 | if __name__ == "__main__": |
| 22 | sys.exit(main()) |