From 2d7a32f7eab5ffac1b9678007ab693c6054ca03c Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Fri, 18 Jul 2014 01:30:29 +0100 Subject: [PATCH] Add test case for using different modules --- testing/python/fixture.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index fdc920c00..d2b18c39b 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -1473,6 +1473,35 @@ class TestFixtureMarker: reprec = testdir.inline_run() reprec.assertoutcome(skipped=2, passed=1) + def test_scope_exc(self, testdir): + testdir.makepyfile( + test_foo=""" + def test_foo(fix): + pass + """, + test_bar=""" + def test_bar(fix): + pass + """, + conftest=""" + import pytest + reqs = [] + @pytest.fixture(scope="session") + def fix(request): + reqs.append(1) + pytest.skip() + @pytest.fixture + def req_list(): + return reqs + """, + test_real=""" + def test_last(req_list): + assert req_list == [1] + """ + ) + reprec = testdir.inline_run() + reprec.assertoutcome(skipped=2, passed=1) + def test_scope_module_uses_session(self, testdir): testdir.makepyfile(""" import pytest