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)
This commit is contained in:
holger krekel 2013-08-02 00:02:28 +02:00
parent 7fc0d45a4c
commit b2ebb80878
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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)