Closed RonnyPfannschmidt closed 10 months ago
Hi! Thanks for informing me! So one day pytest will stop invoking pytest_namespace and the right way of using these plugins would be just importing them?
@TvoroG correct
If anyone else would be encountering the same error as I am: it seems that pytest.lazyfixture
is now being added áfter conftest.py
(cfr. https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace).
So to use lazyfixture
to create 'globally-shared fixtures', you will have to import pytest_lazyfixture
and use pytest_lazyfixture.lazyfixture
(if I got that correctly?)
If anyone else would be encountering the same error as I am: it seems that
pytest.lazyfixture
is now being added áfterconftest.py
(cfr. https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace).So to use
lazyfixture
to create 'globally-shared fixtures', you will have to importpytest_lazyfixture
and usepytest_lazyfixture.lazyfixture
(if I got that correctly?)
I had the exact same problem: I was trying to use pytest.lazy_fixture
in conftest.py
. Importing it from pytest_lazyfixture
instead worked!
_deprecate pytestnamespace alltogether – https://github.com/pytest-dev/pytest/issues/2639 remove pytest namespace hook – https://github.com/pytest-dev/pytest/pull/4421 _#4421: Removed the implementation of the pytestnamespace hook. (note from changelog of pytest 4.1.0 (2019-01-05)) – https://docs.pytest.org/en/stable/changelog.html#id648
@TvoroG I appreciate your hard work. I really do. But, pls, for the love of everything that is good, do update the README. Thanks in advance.
closing this as it seems to be resolved
in pytest we are in the process of deprecating the pytest_namespace hook, so this plugin would need a new location for its api that works when that hook is removed