runner: enable a commented assertion in SetupState.addfinalizer
The assertion ensures that when `addfinalizer(finalizer, node)` is called, the node is in the stack. This then would ensure that the finalization is actually properly executed properly during the node's teardown. Anything else indicates something is wrong. Previous commits fixed all of the tests which previously failed this, so can be reenabeld now.
This commit is contained in:
parent
6db082a448
commit
960ebae943
|
@ -434,8 +434,8 @@ class SetupState:
|
|||
"""Attach a finalizer to the given colitem."""
|
||||
assert colitem and not isinstance(colitem, tuple)
|
||||
assert callable(finalizer)
|
||||
# assert colitem in self.stack # some unit tests don't setup stack :/
|
||||
self._finalizers.setdefault(colitem, []).append(finalizer)
|
||||
assert colitem in self.stack, (colitem, self.stack)
|
||||
self._finalizers[colitem].append(finalizer)
|
||||
|
||||
def teardown_exact(self, nextitem: Optional[Item]) -> None:
|
||||
needed_collectors = nextitem and nextitem.listchain() or []
|
||||
|
|
Loading…
Reference in New Issue