Skip to content

Commit

Permalink
tests: add test_fixture_arg_ordering
Browse files Browse the repository at this point in the history
This is a regression test for part of
pytest-dev#6492, testing one of the
fixes in pytest-dev#6551.
  • Loading branch information
blueyed committed Jan 24, 2020
1 parent 38538c6 commit 22a3b14
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions testing/python/fixtures.py
Expand Up @@ -4207,3 +4207,32 @@ def test_bug(value):
)
result = testdir.runpytest()
result.assert_outcomes(passed=10)


def test_fixture_arg_ordering(testdir):
p1 = testdir.makepyfile(
"""
import pytest
suffixes = []
@pytest.fixture
def fix_1(): suffixes.append("fix_1")
@pytest.fixture
def fix_2(): suffixes.append("fix_2")
@pytest.fixture
def fix_3(): suffixes.append("fix_3")
@pytest.fixture
def fix_4(): suffixes.append("fix_4")
@pytest.fixture
def fix_5(): suffixes.append("fix_5")
@pytest.fixture
def fix_combined(fix_1, fix_2, fix_3, fix_4, fix_5): pass
def test_suffix(fix_combined):
assert suffixes == ["fix_1", "fix_2", "fix_3", "fix_4", "fix_5"]
"""
)
result = testdir.runpytest("-vv", str(p1))
assert result.ret == 0

0 comments on commit 22a3b14

Please sign in to comment.