@@ -1943,32 +1943,6 @@ async def coro():
1943
1943
self .assertEqual (res , 'test' )
1944
1944
self .assertIsNone (t2 .result ())
1945
1945
1946
-
1947
- def test_current_task_deprecated (self ):
1948
- Task = self .__class__ .Task
1949
-
1950
- with self .assertWarns (DeprecationWarning ):
1951
- self .assertIsNone (Task .current_task (loop = self .loop ))
1952
-
1953
- async def coro (loop ):
1954
- with self .assertWarns (DeprecationWarning ):
1955
- self .assertIs (Task .current_task (loop = loop ), task )
1956
-
1957
- # See http://bugs.python.org/issue29271 for details:
1958
- asyncio .set_event_loop (loop )
1959
- try :
1960
- with self .assertWarns (DeprecationWarning ):
1961
- self .assertIs (Task .current_task (None ), task )
1962
- with self .assertWarns (DeprecationWarning ):
1963
- self .assertIs (Task .current_task (), task )
1964
- finally :
1965
- asyncio .set_event_loop (None )
1966
-
1967
- task = self .new_task (self .loop , coro (self .loop ))
1968
- self .loop .run_until_complete (task )
1969
- with self .assertWarns (DeprecationWarning ):
1970
- self .assertIsNone (Task .current_task (loop = self .loop ))
1971
-
1972
1946
def test_current_task (self ):
1973
1947
self .assertIsNone (asyncio .current_task (loop = self .loop ))
1974
1948
@@ -2305,16 +2279,6 @@ def foo():
2305
2279
self .assertIsInstance (exception , Exception )
2306
2280
self .assertEqual (exception .args , ("foo" , ))
2307
2281
2308
- def test_all_tasks_deprecated (self ):
2309
- Task = self .__class__ .Task
2310
-
2311
- async def coro ():
2312
- with self .assertWarns (DeprecationWarning ):
2313
- assert Task .all_tasks (self .loop ) == {t }
2314
-
2315
- t = self .new_task (self .loop , coro ())
2316
- self .loop .run_until_complete (t )
2317
-
2318
2282
def test_log_destroyed_pending_task (self ):
2319
2283
Task = self .__class__ .Task
2320
2284
@@ -2337,15 +2301,7 @@ def kill_me(loop):
2337
2301
2338
2302
self .assertEqual (asyncio .all_tasks (loop = self .loop ), {task })
2339
2303
2340
- # See http://bugs.python.org/issue29271 for details:
2341
- asyncio .set_event_loop (self .loop )
2342
- try :
2343
- with self .assertWarns (DeprecationWarning ):
2344
- self .assertEqual (Task .all_tasks (), {task })
2345
- with self .assertWarns (DeprecationWarning ):
2346
- self .assertEqual (Task .all_tasks (None ), {task })
2347
- finally :
2348
- asyncio .set_event_loop (None )
2304
+ asyncio .set_event_loop (None )
2349
2305
2350
2306
# execute the task so it waits for future
2351
2307
self .loop ._run_once ()
@@ -3043,8 +2999,6 @@ def done(self):
3043
2999
self .assertEqual (asyncio .all_tasks (loop ), set ())
3044
3000
self ._register_task (task )
3045
3001
self .assertEqual (asyncio .all_tasks (loop ), set ())
3046
- with self .assertWarns (DeprecationWarning ):
3047
- self .assertEqual (asyncio .Task .all_tasks (loop ), {task })
3048
3002
self ._unregister_task (task )
3049
3003
3050
3004
def test__enter_task (self ):
0 commit comments