def worker(a, b): assert threading.get_ident() != event_loop_thread_id return run_sync_from_thread(add, a, b)
def thread_func() -> int: with pytest.deprecated_call(): return run_sync_from_thread(threading.get_ident)
def thread_worker(): nonlocal last_active run_sync_from_thread(sleep_event.set) time.sleep(0.2) last_active = 'thread' run_sync_from_thread(finish_event.set)