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

Check for allow_module_level=True in module-level pytest.skip #188

Open
sobolevn opened this issue Jun 27, 2022 · 1 comment
Open

Check for allow_module_level=True in module-level pytest.skip #188

sobolevn opened this issue Jun 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@sobolevn
Copy link

Rule request

Description

Right now this is not detected as an error:

import pytest

pytest.skip('Ignore this module')

Rationale

This is also an error with pytest:

_____________ ERROR collecting tests/test_multiprocess_aioredis.py _____________
Using pytest.skip outside of a test will skip the entire module. If that's your intention, pass `allow_module_level=True`. If you want to skip a specific test or an entire class, use the @pytest.mark.skip or @pytest.mark.skipif decorators.
@sobolevn sobolevn added the enhancement New feature or request label Jun 27, 2022
@m-burst
Copy link
Owner

m-burst commented Jun 27, 2022

Hi @sobolevn,
I'm not sure that duplicating pytest's runtime checks on the linter level is the way to go.
Linters and tests are typically run in the same CI pipeline, so the problem will be detected either way, and this duplication will only lead to extra work (both for me as the developer of the plugin and for the interpreter in runtime).
What do you think?

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