support unittest setUpModule/tearDownModule

This commit is contained in:
variedthoughts 2013-06-20 14:43:42 +00:00
parent 4af052b098
commit 3bcd3317ad
1 changed files with 6 additions and 2 deletions

View File

@ -371,6 +371,8 @@ class Module(pytest.File, PyCollector):
return mod
def setup(self):
setup_module = xunitsetup(self.obj, "setUpModule")
if setup_module is None:
setup_module = xunitsetup(self.obj, "setup_module")
if setup_module is not None:
#XXX: nose compat hack, move to nose plugin
@ -382,6 +384,8 @@ class Module(pytest.File, PyCollector):
setup_module()
def teardown(self):
teardown_module = xunitsetup(self.obj, 'tearDownModule')
if teardown_module is None:
teardown_module = xunitsetup(self.obj, 'teardown_module')
if teardown_module is not None:
#XXX: nose compat hack, move to nose plugin