refine setup ordering some more - test and avoid a problem with funcarg setups where the
surrounding setup_module would fail, but the funcarg setup still be called (which might assume that setup_module has been called so would raise a confusing error) --HG-- branch : trunk
This commit is contained in:
@@ -248,6 +248,10 @@ class SetupState(object):
|
||||
if self.stack == needed_collectors[:len(self.stack)]:
|
||||
break
|
||||
self._pop_and_teardown()
|
||||
# check if the last collection node has raised an error
|
||||
for col in self.stack:
|
||||
if hasattr(col, '_prepare_exc'):
|
||||
py.builtin._reraise(*col._prepare_exc)
|
||||
for col in needed_collectors[len(self.stack):]:
|
||||
self.stack.append(col)
|
||||
try:
|
||||
@@ -255,7 +259,3 @@ class SetupState(object):
|
||||
except Exception:
|
||||
col._prepare_exc = sys.exc_info()
|
||||
raise
|
||||
# check if the last collection node has raised an error
|
||||
for col in self.stack:
|
||||
if hasattr(col, '_prepare_exc'):
|
||||
py.builtin._reraise(*col._prepare_exc)
|
||||
|
||||
Reference in New Issue
Block a user