summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 7c5187348b..e8ec09efd4 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -2076,7 +2076,11 @@ class BaseTaskTests:
self.assertFalse(m_log.error.called)
with self.assertRaises(ValueError):
- self.new_task(self.loop, coro())
+ gen = coro()
+ try:
+ self.new_task(self.loop, gen)
+ finally:
+ gen.close()
self.assertTrue(m_log.error.called)
message = m_log.error.call_args[0][0]