runner: make sure SetupState._finalizers is always set for a node in the stack

This makes the stack <-> _finalizers correspondence clearer.
This commit is contained in:
Ran Benita 2021-01-01 13:55:49 +02:00
parent d1fcd425a3
commit 14d71b2c22
1 changed files with 2 additions and 1 deletions

View File

@ -423,6 +423,7 @@ class SetupState:
needed_collectors = colitem.listchain()
for col in needed_collectors[len(self.stack) :]:
self.stack.append(col)
self._finalizers.setdefault(col, [])
try:
col.setup()
except TEST_OUTCOME as e:
@ -444,7 +445,7 @@ class SetupState:
break
try:
colitem = self.stack.pop()
finalizers = self._finalizers.pop(colitem, None)
finalizers = self._finalizers.pop(colitem)
inner_exc = None
while finalizers:
fin = finalizers.pop()