When I pass reason
instead of msg
to pytest.fail()
PT016 is flagged
#295
Labels
bug
Something isn't working
reason
instead of msg
to pytest.fail()
PT016 is flagged
#295
Bug report
What's wrong
The API of
pytest.fail()
has changed (see here). It is now recommended to use the parameterreason
rather thanmsg
, although the latter is still supported. In my code where I callpytest.fail()
with the parameterreason
but withoutmsg
, PT016 is flagged.How it should work
The PT016 check should look for either
reason
ormsg
. Ifreason
is passed withoutmsg
, PT016 should not be flagged.System information
Other
I would be happy to put up a PR to address this.
The text was updated successfully, but these errors were encountered: