Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.3.3 breaks lazy_fixture pattern #6513

Closed
trendelkampschroer opened this issue Jan 20, 2020 · 8 comments
Closed

5.3.3 breaks lazy_fixture pattern #6513

trendelkampschroer opened this issue Jan 20, 2020 · 8 comments
Labels
topic: fixtures anything involving fixtures directly or indirectly type: bug problem that needs to be addressed

Comments

@trendelkampschroer
Copy link

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

@RonnyPfannschmidt

This comment has been minimized.

@trendelkampschroer

This comment has been minimized.

@blueyed

This comment has been minimized.

@SalmonMode
Copy link
Contributor

@blueyed thanks for the CC. I've never used lazy_fixture before, so I'll have to dig into it a bit, but this issue is separate from the one found in #6492

@blueyed
Copy link
Contributor

blueyed commented Jan 20, 2020

@SalmonMode yeah, thought so myself. I think you/we should go through all the issues being closed off as duplicates maybe too quickly - #6492 appears to be a meta issue for everything this has caused a regression of some kind.

@blueyed blueyed added topic: fixtures anything involving fixtures directly or indirectly type: bug problem that needs to be addressed labels Jan 20, 2020
@nicoddemus
Copy link
Member

Another idea is to list all issues in #6492 itself for book keeping (I mean in the first post, in a separate section).

@RonnyPfannschmidt
Copy link
Member

@nicoddemus is this resolved these days?

@nicoddemus
Copy link
Member

This is working as of pytest-7.4.1 and lazy-fixture-0.6.3:

λ pytest foo.py
======================== test session starts ========================
platform win32 -- Python 3.10.10, pytest-7.4.1, pluggy-1.3.0
rootdir: e:\Temp\venvs
plugins: lazy-fixture-0.6.3
collected 2 items

foo.py ..                                                      [100%]

========================= 2 passed in 0.02s =========================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: fixtures anything involving fixtures directly or indirectly type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

5 participants