runner: schedule node.teardown() call already at setup
This is more elegant.
This commit is contained in:
parent
1db78bec31
commit
0d19aff562
|
@ -422,7 +422,7 @@ class SetupState:
|
|||
needed_collectors = colitem.listchain()
|
||||
for col in needed_collectors[len(self.stack) :]:
|
||||
assert col not in self.stack
|
||||
self.stack[col] = []
|
||||
self.stack[col] = [col.teardown]
|
||||
try:
|
||||
col.setup()
|
||||
except TEST_OUTCOME as e:
|
||||
|
@ -443,7 +443,6 @@ class SetupState:
|
|||
if list(self.stack.keys()) == needed_collectors[: len(self.stack)]:
|
||||
break
|
||||
colitem, finalizers = self.stack.popitem()
|
||||
finalizers.insert(0, colitem.teardown)
|
||||
while finalizers:
|
||||
fin = finalizers.pop()
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue