-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpytest.ini
More file actions
89 lines (75 loc) · 1.86 KB
/
pytest.ini
File metadata and controls
89 lines (75 loc) · 1.86 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
# Pytest Configuration for RBAC Algorithm
#
# This configuration enables comprehensive testing with branch coverage,
# parallel execution, and proper timeout handling.
[tool:pytest]
# Test discovery
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# Output options
addopts =
# Verbose output
-v
--tb=short
# Coverage with branch analysis
--cov=src
--cov-report=html:reports/coverage
--cov-report=term-missing
--cov-report=xml:reports/coverage.xml
--cov-branch
# Fail if coverage drops below 95%
--cov-fail-under=95
# Show test durations
--durations=10
# Strict markers (fail on unknown markers)
--strict-markers
# Show warnings
-W default
# Parallel execution (adjust -n based on CPU cores)
# -n auto
# Test timeout (prevent hanging tests)
--timeout=30
--timeout-method=thread
# Coverage configuration
[coverage:run]
branch = True
source = src
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*
*/conftest.py
[coverage:report]
precision = 2
show_missing = True
skip_covered = False
exclude_lines =
# Standard exclusions
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod
@abc.abstractmethod
# Defensive programming
pass
\.\.\.
[coverage:html]
directory = reports/coverage
# Markers for test organization
[pytest.markers]
unit: Unit tests (fast, isolated)
integration: Integration tests (slower, test component interactions)
property: Property-based tests using Hypothesis
slow: Slow tests (may take more than 1 second)
performance: Performance benchmarks
security: Security-related tests
# Hypothesis configuration
[hypothesis]
max_examples = 100
deadline = None