We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7a39f1 commit 03850cfCopy full SHA for 03850cf
testing/python/fixture.py
@@ -2812,6 +2812,14 @@ def test_bar(arg1):
2812
Hi from test module
2813
''')
2814
2815
+ def test_fixture_disallow_twice(self):
2816
+ """Test that applying @pytest.fixture twice generates an error (#2334)."""
2817
+ with pytest.raises(ValueError):
2818
+ @pytest.fixture
2819
2820
+ def foo():
2821
+ pass
2822
+
2823
2824
@pytest.mark.parametrize('flavor', ['fixture', 'yield_fixture'])
2825
class TestContextManagerFixtureFuncs(object):
0 commit comments