Skip to content

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

@sobolevn

Description

@sobolevn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions