forked from terrene-foundation/kailash-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpytest.ini
More file actions
123 lines (107 loc) · 3.95 KB
/
pytest.ini
File metadata and controls
123 lines (107 loc) · 3.95 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[pytest]
# Test discovery patterns
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
pythonpath = src
norecursedirs = apps sdk-users .git .tox dist build *.egg
# Markers for test categorization
# Tests are organized by directory: tests/unit/, tests/integration/, tests/e2e/
markers =
# Tier markers (automatically applied based on directory)
unit: Unit tests (fast, isolated) - tests/unit/
integration: Integration tests (component interactions) - tests/integration/
e2e: End-to-end tests (complete scenarios) - tests/e2e/
# Priority markers (optional)
critical: Core functionality tests (must always pass)
smoke: Smoke tests (basic functionality check)
regression: Regression tests for previously fixed bugs
# Dependency markers
slow: Slow running tests (30+ min)
requires_docker: Tests requiring Docker services
requires_postgres: Tests requiring PostgreSQL
requires_mysql: Tests requiring MySQL
requires_redis: Tests requiring Redis
requires_ollama: Tests requiring Ollama LLM service
# Other markers
performance: Performance benchmark tests
flaky: Tests that are known to be flaky
asyncio: marks async tests that require asyncio
docker: Tests requiring Docker infrastructure (deprecated - use requires_docker)
ollama: Tests requiring Ollama LLM service (deprecated - use requires_ollama)
ai: Tests involving AI/LLM functionality
data_intensive: Tests with large datasets or heavy processing
stress: Infrastructure stress tests
benchmark: Performance benchmark tests
requires_isolation: Tests that need process isolation due to mock state pollution
endurance: Long-running endurance tests (hours or days)
ci: Tests suitable for CI/CD pipelines (quick execution)
# Tier markers for dataflow tests
tier2: Integration tests with real database infrastructure
tier3: Advanced E2E tests requiring full infrastructure
# Infrastructure requirements
requires_infrastructure: Tests requiring external infrastructure setup
# Environment-aware test options
addopts =
--strict-markers
--tb=short
# Enable asyncio auto mode for pytest-asyncio
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
asyncio_default_test_loop_scope = function
# CI detection and optimization
[pytest:ci]
# CI-specific settings (activated when CI=true environment variable is set)
# Runs only Tier 1 tests (unit tests without external dependencies)
addopts =
-x
-q
--capture=no
--durations=10
--strict-markers
--disable-warnings
--timeout=30
tests/unit/
-m "not (slow or integration or e2e or requires_docker or requires_postgres or requires_mysql or requires_redis or requires_ollama)"
[pytest:local]
# Local development settings (default)
addopts =
-v
--tb=short
--maxfail=10
# Async test support
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
# Timeout for tests (seconds)
# Unit tests: 1 second max (target: < 100ms)
# Integration tests: 5 seconds max (target: 1-2 seconds)
# E2E tests: 10 seconds max (target: 3-5 seconds)
timeout = 10
timeout_method = thread
# Log settings (local only)
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
# Warnings - Show all warnings for now so we can identify and fix them
filterwarnings =
# Show warnings without converting to errors initially
default
# Ignore specific async coroutine warnings from test mocking infrastructure only
ignore:coroutine.*was never awaited:RuntimeWarning
# Ignore deprecated datetime warnings from compiled/dynamic code
ignore:datetime.datetime.utcnow.*is deprecated:DeprecationWarning
# Coverage settings (when needed)
[coverage:run]
parallel = true
concurrency = multiprocessing
omit =
*/tests/*
*/conftest.py
*/__init__.py
*/setup.py
[coverage:report]
skip_covered = true
show_missing = false
precision = 0