Skip to content

Multiline asserts need too many pragma: no covers #461

@nedbat

Description

@nedbat

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!


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions