Skip to content

Commit 18ec85e

Browse files
authored
Merge pull request #55 from ewjoachim/patch-1
Readme: clarify simple usecase
2 parents 5387cd1 + a6ca3a3 commit 18ec85e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ Installation
1313
Usage
1414
-----
1515

16+
pytest-lazy-fixture lets you use a fixture as one of the values passed
17+
in ``@pytest.mark.parametrize``:
18+
19+
.. code-block:: python
20+
21+
import pytest
22+
from pytest_lazyfixture import lazy_fixture
23+
24+
@pytest.fixture
25+
def one():
26+
return 1
27+
28+
@pytest.mark.parametrize('arg1,arg2', [
29+
('val1', lazy_fixture('one')),
30+
])
31+
def test_func(arg1, arg2):
32+
assert arg2 == 1
33+
34+
This can be even more useful when the fixture is itself parametrized:
35+
1636
.. code-block:: python
1737
1838
import pytest

0 commit comments

Comments
 (0)