github-actions[bot]
Automated deployment from GitHub Actions: a9d5a91de63ad7224bafe6039fb2b7479388fbf4
0a8c81b Download tests/conftest.py from VLTA-AI/dropshop: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/VLTA-AI/dropshop/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/tests/conftest.py
823 Bytes
| import pytest | |
| from sqlmodel import SQLModel, create_engine, Session | |
| from src.models.database import get_session | |
| # Create a SQLite in-memory database for testing | |
| sqlite_url = "sqlite:///:memory:" | |
| engine = create_engine(sqlite_url, connect_args={"check_same_thread": False}) | |
| def session_fixture(): | |
| SQLModel.metadata.create_all(engine) | |
| with Session(engine) as session: | |
| yield session | |
| SQLModel.metadata.drop_all(engine) | |
| def override_get_session(session): | |
| def get_session_override(): | |
| yield session | |
| # In src/agents/fulfiller_agent.py, get_session is imported directly. | |
| # To properly mock it, we should patch the specific module where it's used. | |
| # We will do this within the test files using unittest.mock.patch | |
| pass | |