bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462)
Fix "<CoroWrapper ...> was never yielded from" warning in PyTask_PyFuture_Tests.test_error_in_call_soon() of test_asyncio.test_tasks. Close manually the coroutine on error.
This commit is contained in:
parent
7ed61e9431
commit
9f04f0df6f
|
@ -2182,7 +2182,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]
|
||||
|
|
Loading…
Reference in New Issue