Skip to content

B017 - assertRaises - ignore when msg param is passed #479

Closed as not planned
@slw07g

Description

@slw07g

Consider suppressing B017 where msg= is passed to assertRaises, as it also validates the actual message in the raised exception matches msg.

Example:
assertRaises(Exception, msg="Some exception message")

It is equivalent to assertRaisesRegex(Exception, "^<regex_pattern>$") which does not trigger B017.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions