Spaces:
Running
Running
Download analysis/tests/conftest.py from princessamygdala/HarvestForTwo: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/spaces/princessamygdala/HarvestForTwo/resolve/main/analysis/tests/conftest.py
- Command line
-
hf download hf://spaces/princessamygdala/HarvestForTwo/analysis/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/princessamygdala/HarvestForTwo/resolve/main/analysis/tests/conftest.py
1.39 kB
| import sys | |
| from pathlib import Path | |
| import pytest | |
| ANALYSIS = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ANALYSIS)) | |
| from pe_analysis import gitlab # noqa: E402 | |
| def mirror(): | |
| if not gitlab.MIRROR.exists(): | |
| pytest.skip("no local mirror; run pe_analysis.gitlab.pull() first") | |
| return gitlab.MIRROR | |
| def sessions(mirror): | |
| paths = gitlab.session_files(mirror) | |
| if not paths: | |
| pytest.skip("mirror is empty") | |
| return paths | |
| def pilot03(mirror): | |
| p = mirror / "pilot" / "PILOT03" / "PILOT03_2026-08-09_01h06.29.msgpack" | |
| if not p.exists(): | |
| pytest.skip(f"{p.name} not in the mirror") | |
| return p | |
| def watch_session(mirror): | |
| """A session that ran the night watch, the block added after the raids. | |
| Any of them: the fixture picks the newest, so it keeps working as the | |
| pool grows and does not pin the tests to one participant. | |
| """ | |
| paths = [p for p in gitlab.session_files(mirror) | |
| if _ran_the_watch(p)] | |
| if not paths: | |
| pytest.skip("no night-watch session in the mirror") | |
| return sorted(paths)[-1] | |
| def _ran_the_watch(path): | |
| from pe_analysis import loader | |
| names = {r.get("name") for r in loader.read_records(path)} | |
| return "NightWatch" in names | |