Skip to content

Commit

Permalink
Migrate test coverage from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
aphearin committed Sep 8, 2024
1 parent 2c250f5 commit ae1c422
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,42 @@ requires = ["setuptools>=42.0.0",
"extension-helpers==1.*"]

build-backend = 'setuptools.build_meta'


[tool.coverage]

[tool.coverage.run]
omit = [
"halotools/_astropy_init*",
"halotools/__init__*",
"halotools/**/setup*",
"halotools/**/tests/*",
"halotools/extern/*",
"halotools/version*",
"halotools/conftest.py",
"halotools/*setup_package*",
"*/halotools/_astropy_init*",
"*/halotools/conftest.py",
"*/halotools/*setup_package*"
]

[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about packages we have installed
"except ImportError",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain about script hooks
"'def main(.*):'",
# Ignore branches that don't pertain to this version of Python
"pragma: py{ignore_python_version}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
# typing.TYPE_CHECKING is False at runtime
"if TYPE_CHECKING:",
# Ignore typing overloads
"@overload",
]
32 changes: 0 additions & 32 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,3 @@ markers =
slow
installation_test

[coverage:run]
omit =
halotools/_astropy_init*
halotools/conftest.py
halotools/*setup_package*
halotools/tests/*
halotools/*/tests/*
halotools/extern/*
halotools/version*
*/halotools/_astropy_init*
*/halotools/conftest.py
*/halotools/*setup_package*
*/halotools/tests/*
*/halotools/*/tests/*
*/halotools/extern/*
*/halotools/version*

[coverage:report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main\(.*\):
# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}
# Don't complain about IPython completion helper
def _ipython_key_completions_

0 comments on commit ae1c422

Please sign in to comment.