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

I want a rule that will reject direct import of conftest.py #148

Open
abcdenis opened this issue Oct 10, 2021 · 0 comments
Open

I want a rule that will reject direct import of conftest.py #148

abcdenis opened this issue Oct 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@abcdenis
Copy link

Rule request

Description

Catch import_module on AST walking, compare module name with conftest and trigger error on such import.

Rationale

AFAIK (but unable to prove in pytest documentation) conftest.py file intended to store fixtures/plugins/predefinded pytest methods - raw food for pytest.
Direct import of some 'test utility functions' from conftest.py could break things in unusual way.

@abcdenis abcdenis added the enhancement New feature or request label Oct 10, 2021
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

1 participant