flake8-pytest-style
flake8-pytest-style copied to clipboard
Rule to disallow skipped tests
Rule request
Description
Disallow unconditionally skipped tests.
Examples of bad code:
@pytest.mark.skip(reason='some reason')
def test_skipped():
...
@pytest.mark.skipif(True, reason='some reason')
def test_skipped():
...
def test_skipped():
pytest.skip('some reason')
def test_skipped():
if True:
pytest.skip('some reason')
NB: this should not be reported as a violation:
def test_conditionally_skipped():
if some_condition:
pytest.skip('some reason')
Rationale
- to make sure skipped tests are not accidentally committed
- inspired by eslint-plugin-jest rule
no-disabled-tests
What about skipif(True)
?
Thanks @sobolevn, I've added it to the description