question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

5.3.3 breaks `lazy_fixture` pattern

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SalmonModecommented, Jan 20, 2020

@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 https://github.com/pytest-dev/pytest/issues/6492

1reaction
nicoddemuscommented, Jan 20, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytest Documentation - Read the Docs
The “factory as fixture” pattern can help in situations where the result of a fixture ... break pytest's internals. ... pytest-lazy-fixture.
Read more >
pytest-lazy-fixture - PyPI
It helps to use fixtures in pytest.mark.parametrize.
Read more >
FreeBSD - DistroWatch.com
FreeBSD is a UNIX-like operating system for the i386, amd64, IA-64, arm, MIPS, powerpc, ppc64, PC-98 and UltraSPARC platforms based on U.C. Berkeley's ......
Read more >
Debian -- Source Packages in "sid", Subsection misc
... haskell-lambdabot-haskell-plugins (5.3-3); haskell-lambdabot-irc-plugins ... libregexp-pattern-defhash-perl (0.001-3); libregexp-pattern-license-perl ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found