File tree 1 file changed +11
-8
lines changed
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):
219
219
await r .set ("foo" , "foo" )
220
220
await r .set ("bar" , "bar" )
221
221
222
+ async def op (r ):
223
+ with set_delay (delay = delay ):
224
+ return await r .get ("foo" )
225
+
222
226
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
231
234
232
235
# try a number of requests to excercise all the connections
233
236
async def doit ():
You can’t perform that action at this time.
0 commit comments