diff --git a/CHANGELOG b/CHANGELOG index 6c6f8ecf5..dd2fcac51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ Changes between 2.3.5 and 2.4.DEV ----------------------------------- +- fix issue322: tearDownClass is not run if setUpClass failed. Thanks + Mathieu Agopian for fixing. The patch moves handling setUpClass + into a new autofixture. (XXX impl-decide if rather adding addfinalizer() + API to node's would have a similar effect) + - fix issue336: autouse fixture in plugins should work again. - change to use hyphen-separated long options but keep the old spelling diff --git a/_pytest/unittest.py b/_pytest/unittest.py index 8a0244f5d..bec3386b0 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -28,7 +28,8 @@ def _xunit_setUpClass(request): return # skipped setup = getattr(request.cls, 'setUpClass', None) teardown = getattr(request.cls, 'tearDownClass', None) - setup() + if setup is not None: + setup() if teardown is not None: request.addfinalizer(teardown)