We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Test definition should not be placed in a top-level if block. pytest.mark.skipif() should be used instead, if necessary.
if
pytest.mark.skipif()
Bad code:
if sys.platform == 'win32': def test_on_windows_only(): ...
Good code:
@pytest.mark.skipif(sys.platform != 'win32', reason='windows only') def test_on_windows_only(): ...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Rule request
Description
Test definition should not be placed in a top-level
if
block.pytest.mark.skipif()
should be used instead, if necessary.Bad code:
Good code:
Rationale
The text was updated successfully, but these errors were encountered: