def function1790(): with mock.patch('aiohttp.helpers.asyncio') as var1540: var1540.TimeoutError = asyncio.TimeoutError var3747 = mock.Mock() var2743 = helpers.TimerContext(var3747) var2743.timeout() with pytest.raises(asyncio.TimeoutError): with ctx: pass assert var1540.Task.current_task.return_value.cancel.called
def test_timer_context_cancelled() -> None: with mock.patch("aiohttp.helpers.asyncio") as m_asyncio: m_asyncio.TimeoutError = asyncio.TimeoutError loop = mock.Mock() ctx = helpers.TimerContext(loop) ctx.timeout() with pytest.raises(asyncio.TimeoutError): with ctx: pass assert m_asyncio.current_task.return_value.cancel.called
def test_timer_context_no_task(loop) -> None: with pytest.raises(RuntimeError): with helpers.TimerContext(loop): pass
def function2108(arg1342): with pytest.raises(RuntimeError): with helpers.TimerContext(arg1342): pass