Closed
Description
When overriding exclude_lines
e.g. to exclude pytest.fail
or ...
, we often include the existing DEFAULT_EXCLUDE
pattern (currently \#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)
) to maintain the effect of existing "pragma: no cover"s.
This is cumbersome (the regex is large) and doesn't capture the intention, i.e. I have to explain to my team mates what this regex is and where it came from.
Introducing an also_exclude_lines
configuration option (alternative name: "additional_exclude_patterns", which might do better to convey that those are regex patterns), that would be appended to the default list, could address that.
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nedbat commentedon Oct 20, 2022
I like this idea, but I'm not sure when I'll be able to get to it. And I'm not sure what a good name would be. The choices all seem a bit clunky.
ikonst commentedon Oct 20, 2022
Maybe following the example of flake8's extend_ignore?
nedbat commentedon Feb 22, 2023
This is implemented as
exclude_also
in commit 2a0e7bc.Update dependency coverage to v7.2.1 (#99)
chore(deps): update dev (#686)
chore(deps): update dependency coverage to v7.2.2 (#1039)
py-coverage: update to 7.2.5.