-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconftest.py
More file actions
50 lines (38 loc) · 1.25 KB
/
conftest.py
File metadata and controls
50 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""Shared test configuration and fixtures."""
import pytest
import os
# Set test environment variables
os.environ["QDRANT_URL"] = "http://localhost:6333"
os.environ["QDRANT_COLLECTION"] = "test_pyqs"
os.environ["QDRANT_MANIM_COLLECTION"] = "test_manim"
os.environ["RAG_EMBED_MODEL"] = "all-MiniLM-L6-v2"
os.environ["VLLM_SERVER"] = "http://localhost:8000"
@pytest.fixture
def mock_qdrant_response():
"""Fixture providing a mock Qdrant search response."""
from unittest.mock import Mock
def _make_response(texts):
hits = []
for text in texts:
hit = Mock()
hit.payload = {"text": text}
hits.append(hit)
return hits
return _make_response
@pytest.fixture
def mock_manim_response():
"""Fixture providing a mock Manim code response."""
from unittest.mock import Mock
def _make_response(codes):
hits = []
for code in codes:
hit = Mock()
hit.payload = {"code": code}
hits.append(hit)
return hits
return _make_response
def pytest_configure(config):
"""Configure pytest with custom markers."""
config.addinivalue_line(
"markers", "integration: marks tests as integration tests (require Qdrant server)"
)