def test_loop_set_is_running(loop: GLibEventLoop): assert not loop.is_running() loop.set_is_running(True) assert asyncio.get_running_loop() is loop assert loop.is_running()
def test_loop_set_is_not_running(loop: GLibEventLoop): old_loop = Mock() asyncio._set_running_loop(old_loop) loop.set_is_running(True) loop.set_is_running(False) assert not loop.is_running() assert asyncio.get_running_loop() is old_loop