Download tests/test_figures.py from fahadhafeezofficial/clsa-code: direct link, hf CLI and curl.
- Browser
- Download file 797 Bytes
-
https://huggingface.co/datasets/fahadhafeezofficial/clsa-code/resolve/main/tests/test_figures.py
- Command line
-
hf download hf://datasets/fahadhafeezofficial/clsa-code/tests/test_figures.py
-
curl -L -o test_figures.py https://huggingface.co/datasets/fahadhafeezofficial/clsa-code/resolve/main/tests/test_figures.py
797 Bytes
| # Copyright (c) 2026 CLSA contributors | |
| # SPDX-License-Identifier: MIT | |
| """Figures: each script must run when its result exists, and skip cleanly otherwise.""" | |
| from __future__ import annotations | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| ROOT = Path(__file__).resolve().parents[1] | |
| FIGURES = ROOT / "figures" | |
| def test_figure_script(script): | |
| out = subprocess.run( | |
| [sys.executable, script], cwd=str(FIGURES), capture_output=True, text=True | |
| ) | |
| combined = (out.stdout + out.stderr).lower() | |
| if "no such file" in combined or "missing" in combined or "skipped" in combined: | |
| pytest.skip(f"{script}: no result yet") | |
| assert out.returncode == 0, out.stderr[-800:] | |