fix issue177 - actually perform session scope finalization

This commit is contained in:
holger krekel
2012-02-01 08:52:34 -05:00
parent 5263656df6
commit dfa273dc25
4 changed files with 23 additions and 3 deletions

View File

@@ -1551,3 +1551,21 @@ def test_unorderable_types(testdir):
result = testdir.runpytest()
assert "TypeError" not in result.stdout.str()
assert result.ret == 0
def test_issue117_sessionscopeteardown(testdir):
testdir.makepyfile("""
def pytest_funcarg__app(request):
app = request.cached_setup(
scope='session',
setup=lambda: 0,
teardown=lambda x: 3/x)
return app
def test_func(app):
pass
""")
result = testdir.runpytest()
assert result.ret != 0
result.stderr.fnmatch_lines([
"*3/x*",
"*ZeroDivisionError*",
])