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 1efec5a commit c4b365bCopy full SHA for c4b365b
testing/acceptance_test.py
@@ -517,16 +517,15 @@ def pytest_sessionfinish(session):
517
assert collected_file.read() == "collected = 3"
518
519
520
-def test_funcarg_teardown_failure(testdir):
+def test_fixture_teardown_failure(testdir):
521
p = testdir.makepyfile(
522
"""
523
import pytest
524
- @pytest.fixture
+ @pytest.fixture(scope="module")
525
def myarg(request):
526
- def teardown(val):
527
- raise ValueError(val)
528
- return request.cached_setup(setup=lambda: 42, teardown=teardown,
529
- scope="module")
+ yield 42
+ raise ValueError(42)
+
530
def test_hello(myarg):
531
pass
532
0 commit comments