Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ skip = "./.git"
[tool.coverage.run]
branch = true
omit = [
'*/_build/*'
'*/_build/*',
'sphinxcontrib\__init__.py'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? I may be missing something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can update your pytest config so that it produces coverage for the things you want. I moved the pytest config to pyproject.toml below. If you want HTML coverage for the current active python version and installed Sphinx, you call pytest --cov-report=html. The HTML coverage will get generated. Ignoring the init.py is what allows you get coverage for the whole folder sphinxcontrib sanely.

[tool.pytest.ini_options]
addopts = "-ra --strict-config --strict-markers --show-capture=all --showlocals -s -vv --cov=sphinxcontrib --cov=tests --cov-report=term"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
junit_family = "xunit2"
log_cli_level = "INFO"
xfail_strict = true

[tool.coverage.run]
branch = true
omit = [
    '*/_build/*',
    'sphinxcontrib/__init__.py',
]

]

[tool.pytest.ini_options]
Expand Down
Loading
Loading