pytest-dev / pytest-dev/pytest-rerunfailures

Incompatible with pytest lazy_fixture plugin

Open
#109 4 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.