MCPcopy Index your code
hub / github.com/python/cpython / test_other_loop_future

Method test_other_loop_future

Lib/test/test_asyncio/test_tasks.py:150–162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

148 ]))
149
150 def test_other_loop_future(self):
151 other_loop = asyncio.new_event_loop()
152 fut = self.new_future(other_loop)
153
154 async def run(fut):
155 await fut
156
157 try:
158 with self.assertRaisesRegex(RuntimeError,
159 r'Task .* got Future .* attached'):
160 self.loop.run_until_complete(run(fut))
161 finally:
162 other_loop.close()
163
164 def test_task_awaits_on_itself(self):
165

Callers

nothing calls this directly

Calls 6

new_futureMethod · 0.95
assertRaisesRegexMethod · 0.80
runFunction · 0.50
new_event_loopMethod · 0.45
run_until_completeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected