From 3bcd3317adb57213de153347cbf36015094b8719 Mon Sep 17 00:00:00 2001 From: variedthoughts Date: Thu, 20 Jun 2013 14:43:42 +0000 Subject: [PATCH] support unittest setUpModule/tearDownModule --- _pytest/python.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_pytest/python.py b/_pytest/python.py index 3dcc0836f..f2defda1b 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -371,7 +371,9 @@ class Module(pytest.File, PyCollector): return mod def setup(self): - setup_module = xunitsetup(self.obj, "setup_module") + 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 # if it takes a positional arg, its probably a pytest style one @@ -382,7 +384,9 @@ class Module(pytest.File, PyCollector): setup_module() def teardown(self): - teardown_module = xunitsetup(self.obj, 'teardown_module') + 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 # if it takes a positional arg, its probably a py.test style one