Update test that used deprecated cached_setup function

This commit is contained in:
Bruno Oliveira
2018-11-16 12:50:15 -02:00
parent 1efec5a153
commit c4b365b082

View File

@@ -517,16 +517,15 @@ def test_session_testscollected(testdir):
assert collected_file.read() == "collected = 3"
def test_funcarg_teardown_failure(testdir):
def test_fixture_teardown_failure(testdir):
p = testdir.makepyfile(
"""
import pytest
@pytest.fixture
@pytest.fixture(scope="module")
def myarg(request):
def teardown(val):
raise ValueError(val)
return request.cached_setup(setup=lambda: 42, teardown=teardown,
scope="module")
yield 42
raise ValueError(42)
def test_hello(myarg):
pass
"""