diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2022-02-15 10:31:32 +0100 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2022-02-15 14:38:19 +0100 |
| commit | 236e6cb5881168a79a194b43c2d8dff7a14c3f03 (patch) | |
| tree | 3b41f7b4bb7f22ff5cd1162aa5bcaddc9ece93aa /tests/handlers | |
| parent | f7e0bffa2e9c8820c008e742f76b71feaf7dd89f (diff) | |
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.
Diffstat (limited to 'tests/handlers')
| -rw-r--r-- | tests/handlers/views.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/handlers/views.py b/tests/handlers/views.py index e8e248b798..b7d0716afc 100644 --- a/tests/handlers/views.py +++ b/tests/handlers/views.py @@ -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() |
