Skip to content

Commit 3de1062

Browse files
committed
Tests(fix[coverage]): Stop the omit list depending on directory depth
`tests/*/test_*.py` reaches one directory below `tests/`, and `*` does not cross a separator, so every test file nested deeper was measured as though it were library code. Sixty-eight already were. Because those files execute, they report near-total coverage and lift the figure rather than lowering it: the suite reports 84% with them counted and 78% without, so 5,530 statements of test code were worth six points of the library's score. `**` matches any number of nested directories, so one pattern replaces the two that enumerated levels, and a new directory cannot silently fall outside it. The same collapse applies to the `scripts/` entries added alongside them, which had the same one-level ceiling. This is the third place in this tree where a path's depth was written down and then stopped matching when a file moved -- the others being a PEP 723 `path = ".."` and the `parents[1]` lookups in the tests themselves. Each failed silently rather than raising. The reported figure drops six points because it stops averaging the library with its own test suite.
1 parent 301a2b8 commit 3de1062

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,8 @@ parallel = true
155155
omit = [
156156
"*/_compat.py",
157157
"docs/conf.py",
158-
"scripts/*.py",
159-
"scripts/*/*.py",
160-
"tests/test_*.py",
161-
"tests/*/test_*.py",
158+
"scripts/**/*.py",
159+
"tests/**/test_*.py",
162160
]
163161

164162
[tool.coverage.report]

0 commit comments

Comments
 (0)