Datasets:
Download experiments/t2/scripts/test_unit.py from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 640 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/experiments/t2/scripts/test_unit.py
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/experiments/t2/scripts/test_unit.py
-
curl -L -o test_unit.py https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/experiments/t2/scripts/test_unit.py
640 Bytes
| #!/usr/bin/env python3 | |
| """Run the pure T2 unit tests (no Docker, no model, no real benchmark task) with a time cap. | |
| Opt-in container tests in tests/test_e2e_container.py run only when PVBENCH_IMAGE is set. | |
| """ | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| try: | |
| result = subprocess.run([sys.executable, "-B", "-m", "unittest", | |
| *(sys.argv[1:] or ["discover", "-s", "tests", "-v"])], cwd=ROOT, timeout=600) | |
| except subprocess.TimeoutExpired: | |
| print("unit tests exceeded 600 s", file=sys.stderr) | |
| raise SystemExit(1) | |
| raise SystemExit(result.returncode) | |