The bare "config-3.py" omit never matched the phantom's absolute path (D:\a\...\config-3.py), so coverage xml only survived via --ignore-errors and still logged the alarming "No source for code" line. Use a glob (*config-*.py) that matches the phantom at any path while keeping src/config.py measured (verified via coverage GlobMatcher). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
849 B
INI
30 lines
849 B
INI
# .coveragerc to control coverage.py
|
|
[run]
|
|
branch = True
|
|
source = src
|
|
# Exclude conda/xonsh internal shims that leak into coverage data. The phantom
|
|
# is an absolute path like D:\a\...\config-3.py, so a bare "config-3.py" omit
|
|
# never matches — use a glob that matches any path ending in config-<n>.py.
|
|
omit =
|
|
*config-*.py
|
|
*/site-packages/*
|
|
*/conda-meta/*
|
|
|
|
[xml]
|
|
output = coverage.xml
|
|
|
|
[report]
|
|
# Ignore missing source files (conda shims reference files not in tree)
|
|
ignore_errors = True
|
|
# Regexes for lines to exclude from consideration
|
|
exclude_lines =
|
|
# Have to re-enable the standard pragma
|
|
pragma: no cover
|
|
# Don't complain if tests don't hit defensive assertion code:
|
|
raise AssertionError
|
|
raise NotImplementedError
|
|
|
|
# Don't complain if non-runnable code isn't run:
|
|
if 0:
|
|
if __name__ == "__main__":
|