Skip to content

Commit

Permalink
Merge pull request #377 from nicoddemus/pytest-4-fix
Browse files Browse the repository at this point in the history
Update test that used deprecated cached_setup function
  • Loading branch information
RonnyPfannschmidt committed Nov 16, 2018
2 parents 1efec5a + c4b365b commit f206187
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,15 @@ def pytest_sessionfinish(session):
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
"""
Expand Down

0 comments on commit f206187

Please sign in to comment.