From 7d87a1b127249d6051066a5ff0197a10c5505224 Mon Sep 17 00:00:00 2001 From: Oliver Bestwalter Date: Tue, 21 Jun 2016 20:10:22 +0200 Subject: [PATCH] Add test for failing assertion Should contain function name that caused the failure (see pull request #1631). --- testing/python/fixture.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index d6e3250d0..85de0c318 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -490,6 +490,20 @@ class TestRequestBasic: print(ss.stack) assert teardownlist == [1] + def test_mark_as_fixture_with_prefix_and_decorator_fails(self, testdir): + testdir.makeconftest(""" + import pytest + + @pytest.fixture + def pytest_funcarg__marked_with_prefix_and_decorator(): + pass + """) + result = testdir.runpytest_subprocess() + assert result.ret != 0 + result.stdout.fnmatch_lines([ + "*AssertionError:*pytest_funcarg__marked_with_prefix_and_decorator*" + ]) + def test_request_addfinalizer_failing_setup(self, testdir): testdir.makepyfile(""" import pytest