@@ -2588,9 +2588,7 @@ def test_event_loop_policy(self):
2588
2588
def test_get_event_loop (self ):
2589
2589
policy = asyncio .DefaultEventLoopPolicy ()
2590
2590
self .assertIsNone (policy ._local ._loop )
2591
- with self .assertWarns (DeprecationWarning ) as cm :
2592
- loop = policy .get_event_loop ()
2593
- self .assertEqual (cm .filename , __file__ )
2591
+ loop = policy .get_event_loop ()
2594
2592
self .assertIsInstance (loop , asyncio .AbstractEventLoop )
2595
2593
2596
2594
self .assertIs (policy ._local ._loop , loop )
@@ -2604,10 +2602,8 @@ def test_get_event_loop_calls_set_event_loop(self):
2604
2602
policy , "set_event_loop" ,
2605
2603
wraps = policy .set_event_loop ) as m_set_event_loop :
2606
2604
2607
- with self .assertWarns (DeprecationWarning ) as cm :
2608
- loop = policy .get_event_loop ()
2605
+ loop = policy .get_event_loop ()
2609
2606
self .addCleanup (loop .close )
2610
- self .assertEqual (cm .filename , __file__ )
2611
2607
2612
2608
# policy._local._loop must be set through .set_event_loop()
2613
2609
# (the unix DefaultEventLoopPolicy needs this call to attach
@@ -2796,10 +2792,8 @@ def test_get_event_loop_returns_running_loop2(self):
2796
2792
loop = asyncio .new_event_loop ()
2797
2793
self .addCleanup (loop .close )
2798
2794
2799
- with self .assertWarns (DeprecationWarning ) as cm :
2800
- loop2 = asyncio .get_event_loop ()
2795
+ loop2 = asyncio .get_event_loop ()
2801
2796
self .addCleanup (loop2 .close )
2802
- self .assertEqual (cm .filename , __file__ )
2803
2797
asyncio .set_event_loop (None )
2804
2798
with self .assertRaisesRegex (RuntimeError , 'no current' ):
2805
2799
asyncio .get_event_loop ()
0 commit comments