pytest-dev / pytest-dev/pytest-rerunfailures
Incompatible with pytest lazy_fixture plugin
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 477
- Forks
- 107
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 21
Description
Hi all,
Probably similarly to #99 , incompatible with pytest lazy_fixture plugin
In conftest.py, I have the following:
@pytest.fixture
def print_one:
print('one')
@pytest.fixture
def print_two:
print('two')
@pytest.fixture(
params=[
lazy_fixture('print_one'),
lazy_fixture('print_two'),
]
)
def parametrize_prints():
pass
And consider the following failing test:
def test_foo(parametrize_prints):
assert False
Running pytest --reruns 1 -k test_foo -s prints out
oneRF
twoRF
Although the fixture are well identified by pytest in the prints test_file.py::test_foo[print_one]
The example here is trivial, but in my case, I want the system to run some tests at specific times and the tests always pass on re-run because lazy_fixture with freezegun is never executed. This makes the rerunfailures plugin actually unsuitable for us :-(
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
Reproduce the example from conftest.py with pytest-lazy-fixture using pytest --reruns 1 -k test_foo -s, and compare the print_one and print_two cases. Trace how the identified fixture is handled on rerun; done means lazy fixtures execute correctly when the test is rerun instead of being skipped.
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
- 35/100