Spaces:
Sleeping
Sleeping
Download tests/conftest.py from Divb30/intellicode-rag: direct link, hf CLI and curl.
- Browser
- Download file 938 Bytes
-
https://huggingface.co/spaces/Divb30/intellicode-rag/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/Divb30/intellicode-rag/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/Divb30/intellicode-rag/resolve/main/tests/conftest.py
938 Bytes
| """Shared fixtures for the whole test suite.""" | |
| from __future__ import annotations | |
| from pathlib import Path | |
| import pytest | |
| ROOT = Path(__file__).resolve().parent.parent | |
| FIXTURES = ROOT / "tests" / "fixtures" | |
| DOCUMENTS = FIXTURES / "documents" | |
| def documents() -> list[str]: | |
| """The evaluation corpus as a list of raw document strings.""" | |
| return [fp.read_text(encoding="utf-8") for fp in sorted(DOCUMENTS.glob("*.txt"))] | |
| def document_names() -> list[str]: | |
| """Filenames parallel to the ``documents`` fixture.""" | |
| return [fp.name for fp in sorted(DOCUMENTS.glob("*.txt"))] | |
| def buggy_code_path() -> Path: | |
| """Path to the annotated buggy-code fixture.""" | |
| return FIXTURES / "sample_buggy_code.py" | |
| def clean_code_path() -> Path: | |
| """Path to the clean-code fixture.""" | |
| return FIXTURES / "sample_clean_code.py" | |