Download backend/tests/unit/conftest.py from new-arc/vector: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/tests/unit/conftest.py
- Command line
-
hf download hf://spaces/new-arc/vector/backend/tests/unit/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/tests/unit/conftest.py
879 Bytes
| from contextlib import asynccontextmanager | |
| import pytest | |
| from unittest.mock import AsyncMock | |
| def isolated_clip_edits(monkeypatch): | |
| """Keep service unit tests independent of the PostgreSQL edit boundary. | |
| Real transaction behavior is covered in integration/test_clip_edit_atomicity.py. | |
| """ | |
| async def transaction(_db, _task_id): | |
| yield | |
| monkeypatch.setattr( | |
| "src.repositories.edit_transaction.task_edit_transaction", transaction | |
| ) | |
| monkeypatch.setattr( | |
| "src.repositories.task_repository.TaskRepository.load_source_metadata", | |
| AsyncMock(return_value={}), | |
| ) | |
| def disable_paid_youtube_fallback(monkeypatch): | |
| """Local dotenv credentials must never turn a unit test into a paid request.""" | |
| monkeypatch.setenv("RAPIDAPI_YOUTUBE_API_KEY", "") | |