flake8-pytest-style icon indicating copy to clipboard operation
flake8-pytest-style copied to clipboard

Rule to disallow skipped tests

Open m-burst opened this issue 4 years ago • 2 comments

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

m-burst avatar May 07 '20 19:05 m-burst

What about skipif(True)?

sobolevn avatar May 07 '20 20:05 sobolevn

Thanks @sobolevn, I've added it to the description

m-burst avatar May 07 '20 20:05 m-burst