diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 191689d1c2e..58a4c19eab0 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -4536,3 +4536,41 @@ def test_fixt(custom): result.assert_outcomes(errors=1) result.stdout.fnmatch_lines([expected]) assert result.ret == ExitCode.TESTS_FAILED + + +@pytest.mark.xfail( + reason="It isn't differentiated between direct `fixture` param and fixture `fixture`. Will be " + "solved by adding `baseid` to `FixtureArgKey` and baseing fixture keys on param values rather than indices." +) +def test_reorder_with_high_scoped_direct_and_fixture_parametrization( + pytester: Pytester, +): + pytester.makepyfile( + """ + import pytest + + @pytest.fixture(params=[0, 1], scope='module') + def fixture(request): + pass + + def test_1(fixture): + pass + + def test_2(): + pass + + @pytest.mark.parametrize("fixture", [1, 2], scope='module') + def test_3(fixture): + pass + """ + ) + result = pytester.runpytest("--collect-only") + result.stdout.re_match_lines( + [ + r" ", + r" ", + r" ", + r" ", + r" ", + ] + )