-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coveragerc
More file actions
209 lines (167 loc) · 6.05 KB
/
Copy path.coveragerc
File metadata and controls
209 lines (167 loc) · 6.05 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# =============================================================================
# Coverage.py Configuration
# =============================================================================
#
# Code coverage measurement for Python.
# Documentation: https://coverage.readthedocs.io/
#
# This file is portable - copy to other repos without modification.
#
# -----------------------------------------------------------------------------
# Usage
# -----------------------------------------------------------------------------
#
# Run tests with coverage:
# coverage run -m pytest tst/
#
# Generate terminal report:
# coverage report
#
# Generate HTML report:
# coverage html
# open htmlcov/index.html
#
# Generate XML report (for CI):
# coverage xml
#
# Combine parallel coverage data:
# coverage combine
# coverage report
#
# With pytest-cov (recommended):
# pytest --cov=swing.cookie tst/
# pytest --cov=swing.cookie --cov-report=html tst/
#
# =============================================================================
# =============================================================================
# [run] - Data Collection Settings
# =============================================================================
[run]
# ---------------------------------------------------------------------------
# source
# ---------------------------------------------------------------------------
# Directories to measure coverage for.
# Measures coverage for the swing.cookie package.
#
source = src/swing
# ---------------------------------------------------------------------------
# branch
# ---------------------------------------------------------------------------
# Measure branch coverage in addition to statement coverage.
# Reports both "line was executed" and "all branches were taken".
#
# Example:
# if condition: # Branch: True taken? False taken?
# do_something()
#
branch = true
# ---------------------------------------------------------------------------
# parallel
# ---------------------------------------------------------------------------
# Enable parallel test execution support.
# Creates separate .coverage.* files that can be combined with `coverage combine`.
# Essential for pytest-xdist parallel testing.
#
parallel = true
# ---------------------------------------------------------------------------
# omit
# ---------------------------------------------------------------------------
# File patterns to exclude from coverage measurement.
# These files exist but shouldn't count toward coverage percentages.
#
omit =
# Test files (we measure what they test, not the tests themselves)
*/tests/*
*/tst/*
**/conftest.py
# Auto-generated Django files
*/migrations/*
# Cache directories
*/__pycache__/*
# =============================================================================
# [paths] - Source Path Mapping
# =============================================================================
#
# Maps paths from different environments to canonical paths.
# Useful when combining coverage from multiple CI runs or containers.
#
[paths]
source =
src/swing
*/site-packages/swing
# =============================================================================
# [report] - Reporting Options
# =============================================================================
[report]
# ---------------------------------------------------------------------------
# show_missing
# ---------------------------------------------------------------------------
# Show line numbers of statements not covered.
# Output: Name Stmts Miss Cover Missing
# module 100 5 95% 10-12, 45
#
show_missing = true
# ---------------------------------------------------------------------------
# precision
# ---------------------------------------------------------------------------
# Decimal places in coverage percentages.
# 2 = 95.45%, 0 = 95%
#
precision = 2
# ---------------------------------------------------------------------------
# exclude_lines
# ---------------------------------------------------------------------------
# Regex patterns for lines to exclude from coverage.
# Lines matching these patterns won't count as missed.
#
exclude_lines =
# Standard pragma comment
pragma: no cover
# Debug/repr methods (boilerplate)
def __repr__
# Defensive assertions (shouldn't be reached)
raise AssertionError
raise NotImplementedError
# Type checking imports (not executed at runtime)
if TYPE_CHECKING:
# Script entry points
if __name__ == .__main__.:
# Abstract methods (implemented by subclasses)
@abstract
# Typing overloads (not executed)
@overload
# ---------------------------------------------------------------------------
# fail_under
# ---------------------------------------------------------------------------
# Minimum coverage percentage required.
# `coverage report` exits with error if below this threshold.
# Uncomment and set for CI enforcement.
#
# fail_under = 80
# =============================================================================
# [html] - HTML Report Settings
# =============================================================================
[html]
# Output directory for HTML reports
directory = htmlcov
# Title shown in HTML report
title = Swing Coverage Report
# Uncomment to skip files with 100% coverage in the report:
# skip_covered = true
# Uncomment to skip empty files:
# skip_empty = true
# =============================================================================
# [xml] - XML Report Settings (for CI integration)
# =============================================================================
[xml]
# Output path for XML report
# Used by: Codecov, Coveralls, SonarQube, GitHub Actions
output = coverage.xml
# =============================================================================
# [json] - JSON Report Settings
# =============================================================================
[json]
# Output path for JSON report
output = coverage.json
# Include pretty-printed output
# pretty_print = true