Skip to content

Commit 9848889

Browse files
committed
Mimic astropy's coverage setup
1 parent 33e2400 commit 9848889

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,39 @@ doctest_subpackage_requires = [
116116
"docs/sbpy/data/orbit.rst = astroquery,oorb",
117117
"docs/sbpy/data/phys.rst = astroquery",
118118
]
119+
120+
[tool.coverage]
121+
[tool.coverage.run]
122+
omit = [
123+
"sbpy/__init__*",
124+
"sbpy/**/conftest.py",
125+
"sbpy/**/tests/*",
126+
"sbpy/extern/*",
127+
"sbpy/version*",
128+
"*/sbpy/__init__*",
129+
"*/sbpy/**/conftest.py",
130+
"*/sbpy/**/tests/*",
131+
"*/sbpy/extern/*",
132+
"*/sbpy/version*",
133+
]
134+
135+
[tool.coverage.report]
136+
exclude_lines = [
137+
# Have to re-enable the standard pragma
138+
"pragma: no cover",
139+
# Don't complain about packages we have installed
140+
"except ImportError",
141+
# Don't complain if tests don't hit defensive assertion code:
142+
"raise AssertionError",
143+
"raise NotImplementedError",
144+
# Don't complain about script hooks
145+
"'def main(.*):'",
146+
# Ignore branches that don't pertain to this version of Python
147+
"pragma: py{ignore_python_version}",
148+
# Don't complain about IPython completion helper
149+
"def _ipython_key_completions_",
150+
# typing.TYPE_CHECKING is False at runtime
151+
"if TYPE_CHECKING:",
152+
# Ignore typing overloads
153+
"@overload",
154+
]

0 commit comments

Comments
 (0)