Skip to content
Prev Previous commit
Next Next commit
Run test in another thread
  • Loading branch information
iaalm committed Nov 27, 2025
commit f430392ea4b17cd74435c86348e49c4e7ed3e538
4 changes: 2 additions & 2 deletions Lib/test/test_asyncio/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3682,14 +3682,14 @@ def task_factory(loop, coro):

def test_run_coroutine_threadsafe_and_cancel(self):
async def target():
# self.loop.run_in_executor(None, _in_another_thread)
thread_future = asyncio.run_coroutine_threadsafe(self.add(1, 2), self.loop)
await asyncio.sleep(0)

thread_future.cancel()
await asyncio.sleep(0)

self.loop.run_until_complete(target())
future = self.loop.run_in_executor(None, target)
self.loop.run_until_complete(future)
self.assertEqual(0, len(self.loop._ready))


Expand Down
Loading