18
18
19
19
class TestToFuture (unittest .TestCase ):
20
20
def test_await_success (self ):
21
- loop = asyncio .get_event_loop ()
21
+ loop = asyncio .new_event_loop ()
22
22
result = None
23
23
24
24
async def go ():
@@ -30,7 +30,7 @@ async def go():
30
30
assert result == 42
31
31
32
32
def test_await_success_on_sequence (self ):
33
- loop = asyncio .get_event_loop ()
33
+ loop = asyncio .new_event_loop ()
34
34
result = None
35
35
36
36
async def go ():
@@ -42,7 +42,7 @@ async def go():
42
42
assert result == 42
43
43
44
44
def test_await_error (self ):
45
- loop = asyncio .get_event_loop ()
45
+ loop = asyncio .new_event_loop ()
46
46
error = Exception ("error" )
47
47
result = None
48
48
@@ -58,7 +58,7 @@ async def go():
58
58
assert result == error
59
59
60
60
def test_await_empty_observable (self ):
61
- loop = asyncio .get_event_loop ()
61
+ loop = asyncio .new_event_loop ()
62
62
result = None
63
63
64
64
async def go ():
@@ -71,7 +71,7 @@ async def go():
71
71
)
72
72
73
73
def test_await_with_delay (self ):
74
- loop = asyncio .get_event_loop ()
74
+ loop = asyncio .new_event_loop ()
75
75
result = None
76
76
77
77
async def go ():
@@ -83,7 +83,7 @@ async def go():
83
83
assert result == 42
84
84
85
85
def test_cancel (self ):
86
- loop = asyncio .get_event_loop ()
86
+ loop = asyncio .new_event_loop ()
87
87
88
88
async def go ():
89
89
source = reactivex .return_value (42 )
@@ -96,7 +96,7 @@ async def go():
96
96
self .assertRaises (asyncio .CancelledError , loop .run_until_complete , go ())
97
97
98
98
def test_dispose_on_cancel (self ):
99
- loop = asyncio .get_event_loop ()
99
+ loop = asyncio .new_event_loop ()
100
100
sub = Subject ()
101
101
102
102
async def using_sub ():
0 commit comments