pytest-dev / pytest-dev/pytest-bdd
pytest-bdd steps only support fixture using @pytest.fixture, but do not support fixture generated by pytest_generate_tests function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 251
- Avg merge
- 43m
- Merged PRs (30d)
- 2
Description
@given("test generated fixture")
def test_generated_fixture(normal_fixture, generated_fixture):
print(fixture)
print(generated_fixture)
return 1
@pytest.fixture
def normal_fixture():
return 1
defined pytest_generated_tests in conftest.py
def pytest_generate_tests(metafunc):
if "generated_fixture" in metafunc.fixturenames:
metafunc.parametrize("generated_fixture", [1, 2, 3])
will result in error
E fixture 'generated_fixture' not found
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the shown @given example with normal_fixture and generated_fixture, then inspect how pytest-bdd resolves step arguments alongside pytest_generate_tests in conftest.py. Done means the example collects and runs with generated_fixture values 1, 2, and 3 without the “fixture not found” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100