From 115f15600f4db42e27b603233b2d3af3a4867b9a Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Sun, 15 Jun 2014 19:57:52 +0100 Subject: [PATCH] Add test for inter-dependent fixtures Together with cc0a46a13ac4 this fixes issue 467. --- testing/python/fixture.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 51354a57a..fdc920c00 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -1449,6 +1449,30 @@ class TestFixtureMarker: reprec = testdir.inline_run() reprec.assertoutcome(skipped=2, passed=1) + def test_scope_session_exc_two_fix(self, testdir): + testdir.makepyfile(""" + import pytest + l = [] + m = [] + @pytest.fixture(scope="session") + def a(): + l.append(1) + pytest.skip('skipping') + @pytest.fixture(scope="session") + def b(a): + m.append(1) + + def test_1(b): + pass + def test_2(b): + pass + def test_last(): + assert l == [1] + assert m == [] + """) + reprec = testdir.inline_run() + reprec.assertoutcome(skipped=2, passed=1) + def test_scope_module_uses_session(self, testdir): testdir.makepyfile(""" import pytest