pytest_configure: injecting variables into pytest namespace is mypy-incompatible with pytest 8 #11881
-
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:
As this approach is mentioned in the docs I'd expect it to still work.
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).
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ever since the pytest_namespace hook has been deprecated and subsequently been removed, the suggesion is to have own symbols in own modules pytest owns the pytest namespace - nothing else - make a own namespace to store own symbols |
Beta Was this translation helpful? Give feedback.
ever since the pytest_namespace hook has been deprecated and subsequently been removed, the suggesion is to have own symbols in own modules
pytest owns the pytest namespace - nothing else - make a own namespace to store own symbols