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

Research PT009 for Django assertions #220

Open
m-burst opened this issue Feb 14, 2023 · 1 comment
Open

Research PT009 for Django assertions #220

m-burst opened this issue Feb 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@m-burst
Copy link
Owner

m-burst commented Feb 14, 2023

During the implementation of #218 I discovered that some unittest-style assertions we're checking against are actually not from unittest.TestCase but from Django's SimpleTestCase (namely assertNotContains and assertRaisesMessage).

We should possibly research which of the Django assertions can be simply replaced by simple assert statements or replaced with a pytest-idiomatic plugin, and add a rule that would warn about usage of these assertions.

@m-burst m-burst added the enhancement New feature or request label Feb 14, 2023
@jenstroeger
Copy link

I’m working with a Django repo and that’s what I ran into. For now, I’m going to disable that check just to be on the safe side.

Also, any chance you’d consider an “auto-fix” option, that rewrites the code? (Not sure flake8 would allow that, but…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants