-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
40 lines (30 loc) · 1.14 KB
/
conftest.py
File metadata and controls
40 lines (30 loc) · 1.14 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
"""Global pytest configuration and fixtures."""
import pytest
import sys
from pathlib import Path
# Add src to Python path for testing
src_path = Path(__file__).parent / "src"
sys.path.insert(0, str(src_path))
@pytest.fixture(scope="session")
def test_data_dir():
"""Provide path to test data directory."""
return Path(__file__).parent / "tests" / "fixtures"
@pytest.fixture(scope="session", autouse=True)
def setup_test_environment():
"""Set up test environment before running tests."""
# Set test environment variables
import os
os.environ["TESTING"] = "true"
os.environ["DEBUG"] = "true"
os.environ["LOG_LEVEL"] = "DEBUG"
yield
# Cleanup after tests
pass
# Configure pytest markers
def pytest_configure(config):
"""Configure pytest markers."""
config.addinivalue_line("markers", "unit: Unit tests")
config.addinivalue_line("markers", "integration: Integration tests")
config.addinivalue_line("markers", "performance: Performance tests")
config.addinivalue_line("markers", "slow: Slow running tests")
config.addinivalue_line("markers", "algorithm: Algorithm correctness tests")