Skip to content

Commit f206187

Browse files
Merge pull request #377 from nicoddemus/pytest-4-fix
Update test that used deprecated cached_setup function
2 parents 1efec5a + c4b365b commit f206187

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

testing/acceptance_test.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,16 +517,15 @@ def pytest_sessionfinish(session):
517517
assert collected_file.read() == "collected = 3"
518518

519519

520-
def test_funcarg_teardown_failure(testdir):
520+
def test_fixture_teardown_failure(testdir):
521521
p = testdir.makepyfile(
522522
"""
523523
import pytest
524-
@pytest.fixture
524+
@pytest.fixture(scope="module")
525525
def myarg(request):
526-
def teardown(val):
527-
raise ValueError(val)
528-
return request.cached_setup(setup=lambda: 42, teardown=teardown,
529-
scope="module")
526+
yield 42
527+
raise ValueError(42)
528+
530529
def test_hello(myarg):
531530
pass
532531
"""

0 commit comments

Comments
 (0)