File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -4536,3 +4536,41 @@ def test_fixt(custom):
4536
4536
result .assert_outcomes (errors = 1 )
4537
4537
result .stdout .fnmatch_lines ([expected ])
4538
4538
assert result .ret == ExitCode .TESTS_FAILED
4539
+
4540
+
4541
+ @pytest .mark .xfail (
4542
+ reason = "It isn't differentiated between direct `fixture` param and fixture `fixture`. Will be "
4543
+ "solved by adding `baseid` to `FixtureArgKey` and baseing fixture keys on param values rather than indices."
4544
+ )
4545
+ def test_reorder_with_high_scoped_direct_and_fixture_parametrization (
4546
+ pytester : Pytester ,
4547
+ ):
4548
+ pytester .makepyfile (
4549
+ """
4550
+ import pytest
4551
+
4552
+ @pytest.fixture(params=[0, 1], scope='module')
4553
+ def fixture(request):
4554
+ pass
4555
+
4556
+ def test_1(fixture):
4557
+ pass
4558
+
4559
+ def test_2():
4560
+ pass
4561
+
4562
+ @pytest.mark.parametrize("fixture", [1, 2], scope='module')
4563
+ def test_3(fixture):
4564
+ pass
4565
+ """
4566
+ )
4567
+ result = pytester .runpytest ("--collect-only" )
4568
+ result .stdout .re_match_lines (
4569
+ [
4570
+ r" <Function test_1\[0\]>" ,
4571
+ r" <Function test_1\[1\]>" ,
4572
+ r" <Function test_2>" ,
4573
+ r" <Function test_3\[1\]>" ,
4574
+ r" <Function test_3\[2\]>" ,
4575
+ ]
4576
+ )
You can’t perform that action at this time.
0 commit comments