Spaces:
Configuration error
Configuration error
Download tests/conftest.py from ZainabEman/OCR-Based-Spare-Part-Localization: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/spaces/ZainabEman/OCR-Based-Spare-Part-Localization/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/ZainabEman/OCR-Based-Spare-Part-Localization/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/ZainabEman/OCR-Based-Spare-Part-Localization/resolve/main/tests/conftest.py
617 Bytes
| """Shared fixtures. The tests run against the real `1.pdf` — it is fixed and | |
| committed, so it is the fixture.""" | |
| import pytest | |
| from spareparts import build_index, config, pdf_loader | |
| def doc(): | |
| document = pdf_loader.open_document(config.PDF_PATH) | |
| yield document | |
| document.close() | |
| def built(tmp_path_factory): | |
| """Build the index once into a throwaway directory.""" | |
| out = tmp_path_factory.mktemp("index") | |
| summary = build_index.build( | |
| config.PDF_PATH, out / "catalog.db", out / "pages" | |
| ) | |
| return summary, out | |