Spaces:
Running on Zero
Running on Zero
Download run_regression_tests.py from junaid-simamdigital/Simam3D-GPU: direct link, hf CLI and curl.
- Browser
- Download file 970 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/run_regression_tests.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/Simam3D-GPU/run_regression_tests.py
-
curl -L -o run_regression_tests.py https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/run_regression_tests.py
970 Bytes
| """Run every repository regression function and report an exact count.""" | |
| from __future__ import annotations | |
| import inspect | |
| import pathlib | |
| import runpy | |
| def run(root: pathlib.Path | None = None) -> int: | |
| root = root or pathlib.Path(".") | |
| count = 0 | |
| for test_path in sorted((root / "tests").glob("test_*.py")): | |
| namespace = runpy.run_path(str(test_path)) | |
| for name, function in sorted(namespace.items()): | |
| if not name.startswith("test_") or not callable(function): | |
| continue | |
| parameters = list(inspect.signature(function).parameters) | |
| if parameters: | |
| if parameters != ["tmp_path"]: | |
| raise TypeError(f"unsupported test parameters in {test_path.name}:{name}: {parameters}") | |
| function(root) | |
| else: | |
| function() | |
| count += 1 | |
| print(f"tests passed: {count}") | |
| return count | |
| if __name__ == "__main__": | |
| run() | |