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()
|
needed_collectors = colitem.listchain()
|
||||||
for col in needed_collectors[len(self.stack) :]:
|
for col in needed_collectors[len(self.stack) :]:
|
||||||
assert col not in self.stack
|
assert col not in self.stack
|
||||||
self.stack[col] = []
|
self.stack[col] = [col.teardown]
|
||||||
try:
|
try:
|
||||||
col.setup()
|
col.setup()
|
||||||
except TEST_OUTCOME as e:
|
except TEST_OUTCOME as e:
|
||||||
|
@ -443,7 +443,6 @@ class SetupState:
|
||||||
if list(self.stack.keys()) == needed_collectors[: len(self.stack)]:
|
if list(self.stack.keys()) == needed_collectors[: len(self.stack)]:
|
||||||
break
|
break
|
||||||
colitem, finalizers = self.stack.popitem()
|
colitem, finalizers = self.stack.popitem()
|
||||||
finalizers.insert(0, colitem.teardown)
|
|
||||||
while finalizers:
|
while finalizers:
|
||||||
fin = finalizers.pop()
|
fin = finalizers.pop()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue