diff options
author | Thomas Grainger <tagrain@gmail.com> | 2025-03-25 08:29:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-25 08:29:51 +0000 |
commit | 6fb5f7f4d9d22c49f5c29d2ffcbcc32b6cd7d06a (patch) | |
tree | ddf3e47ba96804320143c94f95e99919afbf619b /Lib/test/test_coroutines.py | |
parent | 7d9442f0d55a7169940b9371d6e58a7c2ec1fa8a (diff) | |
download | cpython-6fb5f7f4d9d22c49f5c29d2ffcbcc32b6cd7d06a.tar.gz cpython-6fb5f7f4d9d22c49f5c29d2ffcbcc32b6cd7d06a.zip |
gh-131707: fix unawaited coroutine warning in test_coroutines.Corouti⦠(#131708)
gh-131707: fix unawaited coroutine warning in test_coroutines.CoroutineTest.test_17
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index d78eaaca279..deeaa724e79 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -1199,8 +1199,8 @@ class CoroutineTest(unittest.TestCase): def __aiter__(self): return self - anext_awaitable = anext(A(), "a").__await__() - self.assertRaises(TypeError, anext_awaitable.close, 1) + with contextlib.closing(anext(A(), "a").__await__()) as anext_awaitable: + self.assertRaises(TypeError, anext_awaitable.close, 1) def test_with_1(self): class Manager: |