strict-no-cover
Error on unnecessary pragma: no cover comments.
Utility to report # pragma: no cover comments which are unnecessary (where some of the relevant lines are actually covered).
For cases with flakey coverage or partial coverage on code, use # pragma: lax no cover which will not error if some relevant lines are covered.
Install
uv add --dev strict-no-cover
Usage
After running coverage and generating a .coverage file, run:
uv run strict-no-cover
or without installing it explicitly, run:
uvx strict-no-cover
You'll want to modify pyproject.toml to include the following:
[tool.coverage.report]
exclude_lines = [
# `# pragma: no cover` is standard marker for code that's not covered, this will error if code is covered
'pragma: no cover',
# use `# pragma: lax no cover` if you want to ignore cases where (some of) the code is covered
'pragma: lax no cover',
'raise NotImplementedError',
...
]
Release files for strict-no-cover 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| strict_no_cover-0.1.1.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| strict_no_cover-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / strict_no_cover-0.1.1.tar.gz
| Download URL | strict_no_cover-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
428512000c2f8407008d4834619869b222f88124a0f330d7578caffa6447ea6b
|
|
BLAKE2b-256 checksum How to use checksums |
769c0d3da51690d0d6d9114dacaacf80d8d7f7bfa2226ebbee4ac113ce872fed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Release files / strict_no_cover-0.1.1-py3-none-any.whl
| Download URL | strict_no_cover-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0af14678bbe6ec079931a2f3a4cbe4e1a53e41ccf6d3ffb21f042820acba948b
|
|
BLAKE2b-256 checksum How to use checksums |
c019dc7194d30abe5850324f4829b240f4a0afb37ff57082eb9fdc993054a7ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|