@@ -11,22 +11,7 @@ def tearDownModule():
11
11
asyncio .set_event_loop_policy (None )
12
12
13
13
14
- class BaseTimeoutTests :
15
- Task = None
16
-
17
- def new_task (self , loop , coro , name = 'TestTask' ):
18
- return self .__class__ .Task (coro , loop = loop , name = name )
19
-
20
- def _setupAsyncioLoop (self ):
21
- assert self ._asyncioTestLoop is None , 'asyncio test loop already initialized'
22
- loop = asyncio .new_event_loop ()
23
- asyncio .set_event_loop (loop )
24
- loop .set_debug (True )
25
- self ._asyncioTestLoop = loop
26
- loop .set_task_factory (self .new_task )
27
- fut = loop .create_future ()
28
- self ._asyncioCallsTask = loop .create_task (self ._asyncioLoopRunner (fut ))
29
- loop .run_until_complete (fut )
14
+ class TimeoutTests (unittest .IsolatedAsyncioTestCase ):
30
15
31
16
async def test_timeout_basic (self ):
32
17
with self .assertRaises (TimeoutError ):
@@ -240,15 +225,5 @@ async def test_nested_timeout_in_finally(self):
240
225
await asyncio .sleep (10 )
241
226
242
227
243
- @unittest .skipUnless (hasattr (tasks , '_CTask' ),
244
- 'requires the C _asyncio module' )
245
- class Timeout_CTask_Tests (BaseTimeoutTests , unittest .IsolatedAsyncioTestCase ):
246
- Task = getattr (tasks , '_CTask' , None )
247
-
248
-
249
- class Timeout_PyTask_Tests (BaseTimeoutTests , unittest .IsolatedAsyncioTestCase ):
250
- Task = tasks ._PyTask
251
-
252
-
253
228
if __name__ == '__main__' :
254
229
unittest .main ()
0 commit comments