Skip to content

Commit 22a3b14

Browse files
committed
tests: add test_fixture_arg_ordering
This is a regression test for part of pytest-dev#6492, testing one of the fixes in pytest-dev#6551.
1 parent 38538c6 commit 22a3b14

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Diff for: testing/python/fixtures.py

+29
Original file line numberDiff line numberDiff line change
@@ -4207,3 +4207,32 @@ def test_bug(value):
42074207
)
42084208
result = testdir.runpytest()
42094209
result.assert_outcomes(passed=10)
4210+
4211+
4212+
def test_fixture_arg_ordering(testdir):
4213+
p1 = testdir.makepyfile(
4214+
"""
4215+
import pytest
4216+
4217+
suffixes = []
4218+
4219+
@pytest.fixture
4220+
def fix_1(): suffixes.append("fix_1")
4221+
@pytest.fixture
4222+
def fix_2(): suffixes.append("fix_2")
4223+
@pytest.fixture
4224+
def fix_3(): suffixes.append("fix_3")
4225+
@pytest.fixture
4226+
def fix_4(): suffixes.append("fix_4")
4227+
@pytest.fixture
4228+
def fix_5(): suffixes.append("fix_5")
4229+
4230+
@pytest.fixture
4231+
def fix_combined(fix_1, fix_2, fix_3, fix_4, fix_5): pass
4232+
4233+
def test_suffix(fix_combined):
4234+
assert suffixes == ["fix_1", "fix_2", "fix_3", "fix_4", "fix_5"]
4235+
"""
4236+
)
4237+
result = testdir.runpytest("-vv", str(p1))
4238+
assert result.ret == 0

0 commit comments

Comments
 (0)