Skip to content

5.3.3 breaks lazy_fixture pattern #6513

Description

@trendelkampschroer

First of all thanks a lot for the creation of pytest and all the work that is going into it!

This is the problem I have observed:

pytest-5.3.3 breaks usage of lazy_fixture parametrisation that was working with pytest-5.3.2

pytest: 5.3.3 (conda-forge)
pytest-lazy-fixture: 0.6.2
os: macos catalina
python: 3.6.7

import pytest
from pytest_lazyfixture import lazy_fixture


@pytest.fixture
def foo():
    return "foo"

@pytest.fixture
def bar():
    return "bar"

@pytest.fixture(params=[
    lazy_fixture("foo"),
    lazy_fixture("bar")
])
def myfixture(request):
    return request.param

def test_foo_bar(myfixture):
    assert myfixture in ["foo", "bar"]

This fails with the following error


  @pytest.fixture(params=[
      lazy_fixture("foo"),
      lazy_fixture("bar")
  ])
  def myfixture(request):
E       recursive dependency involving fixture 'foo' detected

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions