Refs #31407 -- Handled potential exception in test cleanup.

The test view may not be called when running the tests with
--parallel=2 or greater. Catch the AttributeError for this case.
This commit is contained in:
Carlton Gibson 2022-02-15 10:31:32 +01:00 committed by Carlton Gibson
parent f7e0bffa2e
commit 236e6cb588
1 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,11 @@ class CoroutineClearingView:
return self._unawaited_coroutine
def __del__(self):
self._unawaited_coroutine.close()
try:
self._unawaited_coroutine.close()
except AttributeError:
# View was never called.
pass
async_unawaited = CoroutineClearingView()