Spaces:
Runtime error
Runtime error
Download tests/conftest.py from Aryanmdev/multilingual-absa: direct link, hf CLI and curl.
- Browser
- Download file 688 Bytes
-
https://huggingface.co/spaces/Aryanmdev/multilingual-absa/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/Aryanmdev/multilingual-absa/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/Aryanmdev/multilingual-absa/resolve/main/tests/conftest.py
688 Bytes
| """Shared pytest fixtures and sys.path bootstrap for the test suite. | |
| Ensures both the `api` package (repo root) and the `absa` package (src-layout) | |
| are importable regardless of how pytest is invoked, so no ``PYTHONPATH`` | |
| environment hacks are required. | |
| """ | |
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| _REPO_ROOT = Path(__file__).resolve().parent.parent | |
| _SRC_DIR = _REPO_ROOT / "src" | |
| for _path in (_REPO_ROOT, _SRC_DIR): | |
| if str(_path) not in sys.path: | |
| sys.path.insert(0, str(_path)) | |
| def _no_network() -> None: | |
| """Fixture placeholder for suite-wide guards (e.g. disable telemetry).""" | |
| yield | |