aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_coroutines.py
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2025-03-25 08:29:51 +0000
committerGitHub <noreply@github.com>2025-03-25 08:29:51 +0000
commit6fb5f7f4d9d22c49f5c29d2ffcbcc32b6cd7d06a (patch)
treeddf3e47ba96804320143c94f95e99919afbf619b /Lib/test/test_coroutines.py
parent7d9442f0d55a7169940b9371d6e58a7c2ec1fa8a (diff)
downloadcpython-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.py4
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: