Skip to content

Commit

Permalink
fix bug in suite class
Browse files Browse the repository at this point in the history
fix nose-devs#280

we should not try to delete the `_previousTestClass` attribute on a
result instance, since it is a class attribute. instead, we just set it
to `None`
  • Loading branch information
little-dude committed Mar 1, 2016
1 parent b2da9b5 commit c22ca31
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nose2/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ def run(self, result):
self._safeMethodCall(self.tearDown, result)

def handle_previous_test_teardown(self, result):
try:
prev = result._previousTestClass
except AttributeError:
prev = getattr(result, '_previousTestClass', None)
if prev is None:
return
layer_attr = getattr(prev, 'layer', None)
if isinstance(layer_attr, LayerSuite):
Expand All @@ -53,7 +52,7 @@ def handle_previous_test_teardown(self, result):
suite_obj._tearDownPreviousClass(None, result)
suite_obj._handleModuleTearDown(result)
finally:
delattr(result, '_previousTestClass')
result._previousTestClass = None

def setUp(self):
if self.layer is None:
Expand Down

0 comments on commit c22ca31

Please sign in to comment.