again addresses issue78 : we now call teardown also if setup raised a Skipped exception.

I also made sure, setup_module/class will only be called once - before they'd be call again
and again if they raise an error or a skip - for each test in their scope.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-01-28 14:20:58 +01:00
parent 4d5ea7be43
commit a2af204687
4 changed files with 44 additions and 9 deletions

View File

@@ -34,6 +34,16 @@ class TestSetupState:
ss.teardown_exact(item)
ss.teardown_exact(item)
def test_setup_fails_and_failure_is_cached(self, testdir):
item = testdir.getitem("""
def setup_module(mod):
raise ValueError(42)
def test_func(): pass
""")
ss = runner.SetupState()
py.test.raises(ValueError, "ss.prepare(item)")
py.test.raises(ValueError, "ss.prepare(item)")
class BaseFunctionalTests:
def test_passfunction(self, testdir):
reports = testdir.runitem("""