Download tests/conftest.py from smlflg/PromptGarage: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/smlflg/PromptGarage/resolve/main/tests/conftest.py
- Command line
-
hf download hf://smlflg/PromptGarage/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/smlflg/PromptGarage/resolve/main/tests/conftest.py
442 Bytes
| """Shared test fixtures for PromptGarage.""" | |
| import os | |
| import sys | |
| import pytest | |
| # Allow imports from project root | |
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) | |
| import db | |
| def temp_db(tmp_path, monkeypatch): | |
| """Use a temporary database for each test.""" | |
| test_db = str(tmp_path / "test_prompts.db") | |
| monkeypatch.setattr(db, "DB_PATH", test_db) | |
| db.init_db() | |
| yield test_db | |