Exception in SubRequest finalizer prevents further registered SubRequest finalizer calls #2440
Labels
topic: fixtures
anything involving fixtures directly or indirectly
type: bug
problem that needs to be addressed
When an exception occurs in a SubRequest's registered finalizer, no further registered finalizers are invoked, causing incomplete teardown. This is not the case for FixtureRequests:
Notice in
test_with_factory_and_fixturerequest
that both registered finalizers are invoked but intest_with_factory_and_subrequest
onlytwo()
is. A workaround is to wrap any teardown calls that can potentially raise exceptions in atry/except
, but this isn't ideal since the exceptions are informative.edit: removed unnecessary functions
The text was updated successfully, but these errors were encountered: