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

Rule to disallow skipped tests #30

Open
m-burst opened this issue May 7, 2020 · 2 comments
Open

Rule to disallow skipped tests #30

m-burst opened this issue May 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@m-burst
Copy link
Owner

m-burst commented May 7, 2020

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 m-burst added the enhancement New feature or request label May 7, 2020
@sobolevn
Copy link

sobolevn commented May 7, 2020

What about skipif(True)?

@m-burst
Copy link
Owner Author

m-burst commented May 7, 2020

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

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