Add test for inter-dependent fixtures

Together with cc0a46a13ac4 this fixes issue 467.
This commit is contained in:
Floris Bruynooghe 2014-06-15 19:57:52 +01:00
parent c46e2cbbc7
commit 115f15600f
1 changed files with 24 additions and 0 deletions

View File

@ -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