Warn when a test doesn't assert anything #9004
Replies: 2 comments 11 replies
-
AFAIK The recently added assertion Pass hook may help (im on mobile so I'll skip on adding the documentation link) |
Beta Was this translation helpful? Give feedback.
-
I think it would be better as a feature request in https://pypi.org/project/flake8-pytest-style/ however there's a number of different ways to assert things about a system in a test that are not supported by the assertion pass hook eg @djmattyg007 I've not been impacted by this specific misconfiguration. Only when tests are simply not executed at all (due to being async/deferred) and that I solve by enforcing 100% coverage on my test suite |
Beta Was this translation helpful? Give feedback.
-
Is there a way to make pytest warn or even fail when a test doesn't assert anything? PHPUnit calls these "risky" or "useless" tests.
https://phpunit.readthedocs.io/en/9.5/risky-tests.html
Beta Was this translation helpful? Give feedback.
All reactions