MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_start_and_stop

Function test_start_and_stop

tests/unit/_utils/test_recurring_task.py:31–41  ·  view source on GitHub ↗
(function: AsyncMock, delay: timedelta)

Source from the content-addressed store, hash-verified

29
30
31async def test_start_and_stop(function: AsyncMock, delay: timedelta) -> None:
32 rt = RecurringTask(function, delay)
33
34 rt.start()
35 await asyncio.sleep(0) # Yield control to allow the task to start
36
37 assert isinstance(rt.task, asyncio.Task)
38 assert not rt.task.done()
39
40 await rt.stop()
41 assert rt.task.done()
42
43
44@pytest.mark.run_alone

Callers

nothing calls this directly

Calls 3

startMethod · 0.95
stopMethod · 0.95
RecurringTaskClass · 0.90

Tested by

no test coverage detected