{"id":13468097,"url":"https://github.com/TvoroG/pytest-lazy-fixture","last_synced_at":"2025-03-26T03:31:32.834Z","repository":{"id":43466225,"uuid":"69617179","full_name":"TvoroG/pytest-lazy-fixture","owner":"TvoroG","description":"It helps to use fixtures in pytest.mark.parametrize","archived":false,"fork":false,"pushed_at":"2023-10-02T21:31:31.000Z","size":71,"stargazers_count":387,"open_issues_count":23,"forks_count":31,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-17T01:17:25.634Z","etag":null,"topics":["pytest","pytest-plugin","python","python3","test","testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TvoroG.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-29T23:52:48.000Z","updated_at":"2025-02-28T12:37:09.000Z","dependencies_parsed_at":"2024-01-14T17:04:53.792Z","dependency_job_id":"7cc7fe32-cf81-4f96-b563-6d430753b556","html_url":"https://github.com/TvoroG/pytest-lazy-fixture","commit_stats":{"total_commits":80,"total_committers":9,"mean_commits":8.88888888888889,"dds":"0.21250000000000002","last_synced_commit":"18ec85edb5e27c933733f748c685b2fd083198d7"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TvoroG%2Fpytest-lazy-fixture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TvoroG%2Fpytest-lazy-fixture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TvoroG%2Fpytest-lazy-fixture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TvoroG%2Fpytest-lazy-fixture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TvoroG","download_url":"https://codeload.github.com/TvoroG/pytest-lazy-fixture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584943,"owners_count":20639648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytest","pytest-plugin","python","python3","test","testing"],"created_at":"2024-07-31T15:01:05.485Z","updated_at":"2025-03-26T03:31:31.819Z","avatar_url":"https://github.com/TvoroG.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"pytest-lazy-fixture |travis-ci| |appveyor| |pypi|\n=================================================\n\nUse your fixtures in ``@pytest.mark.parametrize``.\n\nInstallation\n------------\n\n.. code-block:: shell\n\n    pip install pytest-lazy-fixture\n\nUsage\n-----\n\npytest-lazy-fixture lets you use a fixture as one of the values passed\nin ``@pytest.mark.parametrize``:\n\n.. code-block:: python\n\n    import pytest\n    from pytest_lazyfixture import lazy_fixture\n\n    @pytest.fixture\n    def one():\n        return 1\n\n    @pytest.mark.parametrize('arg1,arg2', [\n        ('val1', lazy_fixture('one')),\n    ])\n    def test_func(arg1, arg2):\n        assert arg2 == 1\n\nThis can be even more useful when the fixture is itself parametrized:\n\n.. code-block:: python\n\n    import pytest\n    from pytest_lazyfixture import lazy_fixture\n\n    @pytest.fixture(params=[1, 2])\n    def one(request):\n        return request.param\n\n    @pytest.mark.parametrize('arg1,arg2', [\n        ('val1', lazy_fixture('one')),\n    ])\n    def test_func(arg1, arg2):\n        assert arg2 in [1, 2]\n\n\nAlso you can use it as a parameter in ``@pytest.fixture``:\n\n.. code-block:: python\n\n    import pytest\n    from pytest_lazyfixture import lazy_fixture\n\n    @pytest.fixture(params=[\n        lazy_fixture('one'),\n        lazy_fixture('two')\n    ])\n    def some(request):\n        return request.param\n\n    @pytest.fixture\n    def one():\n        return 1\n\n    @pytest.fixture\n    def two():\n        return 2\n\n    def test_func(some):\n        assert some in [1, 2]\n\nPlease see `tests \u003chttps://github.com/TvoroG/pytest-lazy-fixture/blob/master/tests/test_lazyfixture.py\u003e`_ for more examples.\n\nContributing\n------------\n\nContributions are very welcome. Tests can be run with ``tox``.\n\nLicense\n-------\n\nDistributed under the terms of the ``MIT`` license,\n``pytest-lazy-fixture`` is free and open source software\n\nIssues\n------\n\nIf you encounter any problems, please ``file an issue`` along with a\ndetailed description.\n\n.. |travis-ci| image:: https://travis-ci.org/TvoroG/pytest-lazy-fixture.svg?branch=master\n    :target: https://travis-ci.org/TvoroG/pytest-lazy-fixture\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/TvoroG/pytest-fixture-mark?branch=master\u0026svg=true\n    :target: https://ci.appveyor.com/project/TvoroG/pytest-fixture-mark\n.. |pypi| image:: https://badge.fury.io/py/pytest-lazy-fixture.svg\n    :target: https://pypi.python.org/pypi/pytest-lazy-fixture/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTvoroG%2Fpytest-lazy-fixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTvoroG%2Fpytest-lazy-fixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTvoroG%2Fpytest-lazy-fixture/lists"}