Download tests/conftest.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 983 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/79a3ba9f4e42fd32c044a620f4d4326e974b6f9d/tests/conftest.py
- Command line
-
hf download hf://datasets/tailot/codex-python@79a3ba9f4e42fd32c044a620f4d4326e974b6f9d/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/datasets/tailot/codex-python/resolve/79a3ba9f4e42fd32c044a620f4d4326e974b6f9d/tests/conftest.py
983 Bytes
| """Shared pytest fixtures for the external datasets/codex-python package.""" | |
| from __future__ import annotations | |
| import shutil | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| sys.dont_write_bytecode = True | |
| PYTHON_ROOT = Path(__file__).resolve().parent.parent | |
| if str(PYTHON_ROOT) not in sys.path: | |
| sys.path.insert(0, str(PYTHON_ROOT)) | |
| from lgpython._codex_bridge import ensure_codex_on_path # noqa: E402 | |
| ensure_codex_on_path(PYTHON_ROOT) | |
| def sample_pkg(tmp_path: Path) -> Path: | |
| """Copy fixtures/sample_pkg into a clean temporary directory per test.""" | |
| src = PYTHON_ROOT / "fixtures" / "sample_pkg" | |
| dst = tmp_path / "sample_pkg" | |
| shutil.copytree(src, dst) | |
| return dst | |
| def pattern_lab(tmp_path: Path) -> Path: | |
| """A private copy of the pattern fixture, for tests that write into it.""" | |
| src = PYTHON_ROOT / "fixtures" / "pattern_lab" | |
| dst = tmp_path / "pattern_lab" | |
| shutil.copytree(src, dst) | |
| return dst | |