synthex / run_tests.py
theaniketgiri's picture
backend
3f61e65
raw
history blame contribute delete
550 Bytes
import subprocess
import sys
import os
import platform
def run_tests():
print("Running tests...")
if platform.system() == "Windows":
python = "venv/Scripts/python"
else:
python = "venv/bin/python"
try:
subprocess.run(
[python, "-m", "pytest", "tests/", "-v"],
check=True
)
print("\nAll tests passed successfully!")
except subprocess.CalledProcessError:
print("\nSome tests failed!")
sys.exit(1)
if __name__ == "__main__":
run_tests()