Skip to content

Commit 7d87a1b

Browse files
committed
Add test for failing assertion
Should contain function name that caused the failure (see pull request #1631).
1 parent c3ee1c1 commit 7d87a1b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

testing/python/fixture.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,20 @@ def test_func(something): pass
490490
print(ss.stack)
491491
assert teardownlist == [1]
492492

493+
def test_mark_as_fixture_with_prefix_and_decorator_fails(self, testdir):
494+
testdir.makeconftest("""
495+
import pytest
496+
497+
@pytest.fixture
498+
def pytest_funcarg__marked_with_prefix_and_decorator():
499+
pass
500+
""")
501+
result = testdir.runpytest_subprocess()
502+
assert result.ret != 0
503+
result.stdout.fnmatch_lines([
504+
"*AssertionError:*pytest_funcarg__marked_with_prefix_and_decorator*"
505+
])
506+
493507
def test_request_addfinalizer_failing_setup(self, testdir):
494508
testdir.makepyfile("""
495509
import pytest

0 commit comments

Comments
 (0)