Multiline asserts need too many pragma: no covers · Issue #461 · nedbat/coveragepy (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Originally reported by Barry Warsaw (Bitbucket: warsaw, GitHub: warsaw)
Code like the following:
#!python
assert command_class.name not in config.commands, ( # pragma: no cover
'Duplicate email command "{}" found in {}'.format( # pragma: no cover
command_class.name, # pragma: no cover
command_class.__module__))
Note the pragma: no cover
on every line. I want to completely ignore the entire assert statement, but w/o all those pragmas, I get a report that some of those lines aren't covered, which is true, but unhelpful!