TvoroG / pytest-lazy-fixture

It helps to use fixtures in pytest.mark.parametrize
MIT License
379 stars 30 forks source link

prepare for the deprecation/removal of the pytest_namespace hook #16

Closed RonnyPfannschmidt closed 10 months ago

RonnyPfannschmidt commented 7 years ago

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

TvoroG commented 7 years 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?

RonnyPfannschmidt commented 7 years ago

@TvoroG correct

YannickJadoul commented 6 years ago

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?)

jmehnle commented 4 years ago

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?)

I had the exact same problem: I was trying to use pytest.lazy_fixture in conftest.py. Importing it from pytest_lazyfixture instead worked!

piotr-dobrogost commented 3 years ago

_deprecate pytestnamespace alltogetherhttps://github.com/pytest-dev/pytest/issues/2639 remove pytest namespace hookhttps://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

z33kz33k commented 2 years ago

@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.

RonnyPfannschmidt commented 10 months ago

closing this as it seems to be resolved