File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -219,15 +219,18 @@ def set_delay(delay: int = 0):
219219 await r .set ("foo" , "foo" )
220220 await r .set ("bar" , "bar" )
221221
222+ async def op (r ):
223+ with set_delay (delay = delay ):
224+ return await r .get ("foo" )
225+
222226 all_clear ()
223- with set_delay (delay = delay ):
224- t = asyncio .create_task (r .get ("foo" ))
225- # One of the proxies will handle our request, wait for it to send
226- await any_wait ()
227- await asyncio .sleep (delay )
228- t .cancel ()
229- with pytest .raises (asyncio .CancelledError ):
230- await t
227+ t = asyncio .create_task (op (r ))
228+ # One of the proxies will handle our request, wait for it to send
229+ await any_wait ()
230+ await asyncio .sleep (delay )
231+ t .cancel ()
232+ with pytest .raises (asyncio .CancelledError ):
233+ await t
231234
232235 # try a number of requests to excercise all the connections
233236 async def doit ():
You can’t perform that action at this time.
0 commit comments