Skip to content

Commit f430392

Browse files
committed
Run test in another thread
1 parent d7675d3 commit f430392

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_asyncio/test_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,14 +3682,14 @@ def task_factory(loop, coro):
36823682

36833683
def test_run_coroutine_threadsafe_and_cancel(self):
36843684
async def target():
3685-
# self.loop.run_in_executor(None, _in_another_thread)
36863685
thread_future = asyncio.run_coroutine_threadsafe(self.add(1, 2), self.loop)
36873686
await asyncio.sleep(0)
36883687

36893688
thread_future.cancel()
36903689
await asyncio.sleep(0)
36913690

3692-
self.loop.run_until_complete(target())
3691+
future = self.loop.run_in_executor(None, target)
3692+
self.loop.run_until_complete(future)
36933693
self.assertEqual(0, len(self.loop._ready))
36943694

36953695

0 commit comments

Comments
 (0)