diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-01 09:58:13 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-01 10:06:08 +0300 |
commit | 226ad6e44ddaecc763a95f179974da04b9c9fa83 (patch) | |
tree | cc5e80f25011577935b602920306bd185a1bf336 /contrib/python | |
parent | fc4a5bce8457dd4aa05f857e0fc36183245a7fff (diff) | |
download | ydb-226ad6e44ddaecc763a95f179974da04b9c9fa83.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python')
5 files changed, 8 insertions, 22 deletions
diff --git a/contrib/python/pytest-lazy-fixtures/.dist-info/METADATA b/contrib/python/pytest-lazy-fixtures/.dist-info/METADATA index 260a9b18cc..e03b9014b7 100644 --- a/contrib/python/pytest-lazy-fixtures/.dist-info/METADATA +++ b/contrib/python/pytest-lazy-fixtures/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest-lazy-fixtures -Version: 1.0.7 +Version: 1.1.0 Summary: Allows you to use fixtures in @pytest.mark.parametrize. Home-page: https://github.com/dev-petrov/pytest-lazy-fixtures License: MIT @@ -43,7 +43,7 @@ pip install pytest-lazy-fixtures ## Usage -To use your fixtures inside `@pytest.mark.parametrize` you can use `lf` (`lazy_fixture`) or `pytest.lazy_fixtures`. +To use your fixtures inside `@pytest.mark.parametrize` you can use `lf` (`lazy_fixture`). ```python import pytest @@ -56,10 +56,6 @@ def one(): @pytest.mark.parametrize('arg1,arg2', [('val1', lf('one'))]) def test_func(arg1, arg2): assert arg2 == 1 - -@pytest.mark.parametrize('arg1,arg2', [('val1', pytest.lazy_fixtures('one'))]) -def test_func(arg1, arg2): - assert arg2 == 1 ``` `lf` can be used with any data structures. For example, in the following example, `lf` is used in the dictionary: @@ -96,7 +92,7 @@ def test_func(arg1, arg2): assert arg2 == 1 ``` -And there is some useful wrapper called `lfc` (`lazy_fixture_callable`) or `pytest.lazy_fixtures_callable`. +And there is some useful wrapper called `lfc` (`lazy_fixture_callable`). It can work with any callable and your fixtures, e.g. ```python diff --git a/contrib/python/pytest-lazy-fixtures/README.md b/contrib/python/pytest-lazy-fixtures/README.md index 6c13ec033a..ba6ff870da 100644 --- a/contrib/python/pytest-lazy-fixtures/README.md +++ b/contrib/python/pytest-lazy-fixtures/README.md @@ -22,7 +22,7 @@ pip install pytest-lazy-fixtures ## Usage -To use your fixtures inside `@pytest.mark.parametrize` you can use `lf` (`lazy_fixture`) or `pytest.lazy_fixtures`. +To use your fixtures inside `@pytest.mark.parametrize` you can use `lf` (`lazy_fixture`). ```python import pytest @@ -35,10 +35,6 @@ def one(): @pytest.mark.parametrize('arg1,arg2', [('val1', lf('one'))]) def test_func(arg1, arg2): assert arg2 == 1 - -@pytest.mark.parametrize('arg1,arg2', [('val1', pytest.lazy_fixtures('one'))]) -def test_func(arg1, arg2): - assert arg2 == 1 ``` `lf` can be used with any data structures. For example, in the following example, `lf` is used in the dictionary: @@ -75,7 +71,7 @@ def test_func(arg1, arg2): assert arg2 == 1 ``` -And there is some useful wrapper called `lfc` (`lazy_fixture_callable`) or `pytest.lazy_fixtures_callable`. +And there is some useful wrapper called `lfc` (`lazy_fixture_callable`). It can work with any callable and your fixtures, e.g. ```python diff --git a/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/loader.py b/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/loader.py index 3c675c2aaf..d2d39ff4f8 100644 --- a/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/loader.py +++ b/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/loader.py @@ -14,7 +14,7 @@ def load_lazy_fixtures(value, request: pytest.FixtureRequest): return value.load_fixture(request) # we need to check exact type if type(value) is dict: # noqa: E721 - return {key: load_lazy_fixtures(value, request) for key, value in value.items()} + return {load_lazy_fixtures(key, request): load_lazy_fixtures(value, request) for key, value in value.items()} # we need to check exact type elif type(value) in {list, tuple, set}: return type(value)([load_lazy_fixtures(value, request) for value in value]) diff --git a/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/plugin.py b/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/plugin.py index de7d75a4f7..f3475e199c 100644 --- a/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/plugin.py +++ b/contrib/python/pytest-lazy-fixtures/pytest_lazy_fixtures/plugin.py @@ -1,16 +1,10 @@ import pytest -from .lazy_fixture import LazyFixtureWrapper, lf -from .lazy_fixture_callable import lfc +from .lazy_fixture import LazyFixtureWrapper from .loader import load_lazy_fixtures from .normalizer import normalize_metafunc_calls -def pytest_configure(): - pytest.lazy_fixtures = lf - pytest.lazy_fixtures_callable = lfc - - @pytest.hookimpl(tryfirst=True) def pytest_fixture_setup(fixturedef, request): val = getattr(request, "param", None) diff --git a/contrib/python/pytest-lazy-fixtures/ya.make b/contrib/python/pytest-lazy-fixtures/ya.make index b672f39330..47d86e8e02 100644 --- a/contrib/python/pytest-lazy-fixtures/ya.make +++ b/contrib/python/pytest-lazy-fixtures/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(1.0.7) +VERSION(1.1.0) LICENSE(MIT) |