async def test_weakref_handle_with_small_threshold(loop) -> None: cb = mock.Mock() loop = mock.Mock() loop.time.return_value = 10 helpers.weakref_handle(cb, "test", 0.1, loop, 0.01) loop.call_at.assert_called_with(11, helpers._weakref_handle, (weakref.ref(cb), "test"))
async def test_weakref_handle_weak(loop) -> None: cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) del cb gc.collect() await asyncio.sleep(0.1)
async def test_weakref_handle(loop) -> None: cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) await asyncio.sleep(0.1) assert cb.test.called
def test_weakref_handle_weak(loop): cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) del cb gc.collect() yield from asyncio.sleep(0.1, loop=loop)
def test_weakref_handle(loop): cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) yield from asyncio.sleep(0.1, loop=loop) assert cb.test.called
def function1996(arg1868): var2814 = mock.Mock() helpers.weakref_handle(var2814, 'test', 0.01, arg1868, False) del cb gc.collect() yield from asyncio.sleep(0.1, loop=arg1868)
def function2386(arg2124): var1200 = mock.Mock() helpers.weakref_handle(var1200, 'test', 0.01, arg2124, False) yield from asyncio.sleep(0.1, loop=arg2124) assert var1200.test.called
async def test_weakref_handle_weak(loop): cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) del cb gc.collect() await asyncio.sleep(0.1, loop=loop)
async def test_weakref_handle(loop): cb = mock.Mock() helpers.weakref_handle(cb, 'test', 0.01, loop, False) await asyncio.sleep(0.1, loop=loop) assert cb.test.called