Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I pass reason instead of msg to pytest.fail() PT016 is flagged #295

Open
jonssonchristian opened this issue Jun 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jonssonchristian
Copy link

jonssonchristian commented Jun 21, 2024

Bug report

What's wrong

The API of pytest.fail() has changed (see here). It is now recommended to use the parameter reason rather than msg, although the latter is still supported. In my code where I call pytest.fail() with the parameter reason but without msg, PT016 is flagged.

How it should work

The PT016 check should look for either reason or msg. If reason is passed without msg, PT016 should not be flagged.

System information

  • Operating system: Windows 11 Pro
  • Python version: 3.11.9
  • flake8 version: 7.1.0
  • flake8-pytest-style version: 2.0.0
  • pytest version: 8.2.2

Other

I would be happy to put up a PR to address this.

@jonssonchristian jonssonchristian added the bug Something isn't working label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant