(function: AsyncMock, delay: timedelta)
| 29 | |
| 30 | |
| 31 | async 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 |
nothing calls this directly
no test coverage detected