mirror of
https://github.com/django/django.git
synced 2025-01-31 20:59:17 +00:00
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:
parent
f7e0bffa2e
commit
236e6cb588
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user