Merge pull request #377 from nicoddemus/pytest-4-fix
Update test that used deprecated cached_setup function
This commit is contained in:
@@ -517,16 +517,15 @@ def test_session_testscollected(testdir):
|
|||||||
assert collected_file.read() == "collected = 3"
|
assert collected_file.read() == "collected = 3"
|
||||||
|
|
||||||
|
|
||||||
def test_funcarg_teardown_failure(testdir):
|
def test_fixture_teardown_failure(testdir):
|
||||||
p = testdir.makepyfile(
|
p = testdir.makepyfile(
|
||||||
"""
|
"""
|
||||||
import pytest
|
import pytest
|
||||||
@pytest.fixture
|
@pytest.fixture(scope="module")
|
||||||
def myarg(request):
|
def myarg(request):
|
||||||
def teardown(val):
|
yield 42
|
||||||
raise ValueError(val)
|
raise ValueError(42)
|
||||||
return request.cached_setup(setup=lambda: 42, teardown=teardown,
|
|
||||||
scope="module")
|
|
||||||
def test_hello(myarg):
|
def test_hello(myarg):
|
||||||
pass
|
pass
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user