Skip to content

Commit a4a6af9

Browse files
committed
ignore in test coverage script
1 parent 5b56044 commit a4a6af9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/test_coverage.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
_SCIPY: Final = "scipy"
1212
_IGNORED_SUFFIXES: Final = {"__class__"}
13+
_IGNORED_QUALNAMES: Final = {
14+
# `scipy.stats.chi2_contingency` is a re-export of
15+
# `scipy.stats.contingency.chi2_contingency`, which is already tested in
16+
# `tests/stats/test_contingency.pyi`.
17+
"scipy.stats.chi2_contingency"
18+
}
1319

1420
_PACKAGES_PUBLIC: Final = (
1521
"cluster",
@@ -225,6 +231,8 @@ def _parse_scipy_imports(tree: ast.AST) -> dict[str, str]:
225231

226232
def _should_ignore(qualname: str) -> bool:
227233
"""Check if a qualified name should be ignored (private or bare package)."""
234+
if qualname in _IGNORED_QUALNAMES:
235+
return True # explicitly ignored public re-exports
228236
if qualname.endswith(("Warning", "Error")):
229237
return True # exceptions
230238
parts = qualname.split(".")

0 commit comments

Comments
 (0)