Skip to content

Commit

Permalink
Hide external from coverage report (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
analog-cbarber committed Apr 15, 2024
1 parent 3e7db41 commit 86a9f4f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = True

[report]
include = src/whl2conda/*
omit = src/whl2conda/external/*
exclude_lines =
pragma: no cover
raise AssertionError
raise NotImplementedError

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ build/
*.tar.bz2

# test files
.coverage*
.coverage
.coverage.*
coverage.json
coverage.xml

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def pytest_configure(config):
Add external marker to pytest configuration
"""
config.addinivalue_line(
"markers", "external: mark test as depending on extenral pypi package to run"
"markers", "external: mark test as depending on external pypi package to run"
)
config.addinivalue_line("markers", "slow: mark test as slow to run")

Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ pattern = "\\s*(?P<version>[\\w.]*)"
[tool.hatch.build.targets.wheel]
packages = ["src/whl2conda"]

# TODO: Using coverage config in pyproject is resulting in
# INTERNALERROR> coverage.exceptions.DataError: Can't combine line data with arc data
#
#[tool.coverage.run]
#branch = true
#
#[tool.coverage.report]
#include = ["src/whl2conda/*"]
#omit = ["src/whl2conda/external/*"]
#exclude_also = [
# "pragma: no cover",
# "raise AssertionError",
# "raise NotImplementedError"
#]

[tool.black]
line-length = 88
skip-string-normalization = true
Expand Down

0 comments on commit 86a9f4f

Please sign in to comment.