Spaces:
Sleeping
Sleeping
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() |