@@ -149,16 +149,6 @@ async def outer() -> None:
149
149
assert not task .cancelled ()
150
150
assert task .done ()
151
151
152
- async def test_nested_timeouts (self ):
153
- with self .assertRaises (TimeoutError ):
154
- async with asyncio .timeout (0.1 ) as outer :
155
- try :
156
- async with asyncio .timeout (0.2 ) as inner :
157
- await asyncio .sleep (10 )
158
- except asyncio .TimeoutError :
159
- # Pretend we start a super long operation here.
160
- self .assertTrue (False )
161
-
162
152
async def test_nested_timeouts_concurrent (self ):
163
153
with self .assertRaises (TimeoutError ):
164
154
async with asyncio .timeout (0.002 ):
@@ -179,19 +169,19 @@ async def test_nested_timeouts_loop_busy(self):
179
169
"""
180
170
start = time .perf_counter ()
181
171
try :
182
- async with asyncio .timeout (0.002 ) as outer :
172
+ async with asyncio .timeout (0.002 ):
183
173
try :
184
- async with asyncio .timeout (0.001 ) as inner :
174
+ async with asyncio .timeout (0.001 ):
185
175
# Pretend the loop is busy for a while.
186
176
time .sleep (0.010 )
187
177
await asyncio .sleep (0.001 )
188
178
except asyncio .TimeoutError :
189
179
# This sleep should be interrupted.
190
- await asyncio .sleep (0.050 )
180
+ await asyncio .sleep (10 )
191
181
except asyncio .TimeoutError :
192
182
pass
193
183
took = time .perf_counter () - start
194
- self .assertTrue (took <= 0.015 )
184
+ self .assertTrue (took <= 1 )
195
185
196
186
197
187
@unittest .skipUnless (hasattr (tasks , '_CTask' ),
0 commit comments