From cb485e5af45f2d0e6d8290da187a02b03a01c412 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 4 Dec 2013 16:09:37 +0100 Subject: [PATCH] reopen #246 -- it turns out parametrized finalization ordering is not fully fixed -- i modified the test and marked it xfail for now. --- testing/python/fixture.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index e1c91e068..527d886be 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -1855,6 +1855,7 @@ class TestFixtureMarker: reprec.assertoutcome(passed=5) + @pytest.mark.xfail @pytest.mark.issue246 @pytest.mark.parametrize("scope", ["session", "function", "module"]) def test_finalizer_order_on_parametrization(self, scope, testdir): @@ -1876,15 +1877,18 @@ class TestFixtureMarker: def base(request, fix1): def cleanup_base(): l.append("fin_base") + print ("finalizing base") request.addfinalizer(cleanup_base) + def test_begin(): + pass def test_baz(base, fix2): pass def test_other(): pass """ % {"scope": scope}) - reprec = testdir.inline_run() - reprec.assertoutcome(passed=2) + reprec = testdir.inline_run("-lvs") + reprec.assertoutcome(passed=3) def test_parametrize_setup_function(self, testdir): testdir.makepyfile("""