-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
type: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Description
Hello, thanks for your great and invaluable work on pytest. I just updated to pytest 8 and I'm getting linter errors on the following scenario:
https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace
import pytest
def pytest_configure():
pytest.my_symbol = MySymbol()The error:
error: Module has no attribute "my_symbol" [attr-defined]
As this approach is mentioned in the docs I'd expect it to still work.
- Is there a way to still do this without disabling mypy everywhere the variable is used?
- Is there a different approach that is considered better?
Context: I'm using the variable to share data between a pytest plugin I develop and the module (i.e. module defines the variable - plugin uses it).
pytest 8.0.0, mypy 1.8.0
- a detailed description of the bug or problem you are having
- output of
pip listfrom the virtual environment you are using - pytest and operating system versions
- minimal example if possible
Metadata
Metadata
Assignees
Labels
type: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity