From c4b365b082452fd425d19ab1db0e51653767ce45 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 16 Nov 2018 12:50:15 -0200 Subject: [PATCH] Update test that used deprecated cached_setup function --- testing/acceptance_test.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index be4c7d8..02f2d20 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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 """