File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ filterwarnings = [
117
117
" module:unclosed <ssl.SSLSocket:ResourceWarning" ,
118
118
" module:unclosed <socket object:ResourceWarning" ,
119
119
" module:unclosed transport:ResourceWarning" ,
120
+ # pytest-asyncio known issue: https://github.com/pytest-dev/pytest-asyncio/issues/724
121
+ " module:unclosed event loop:ResourceWarning" ,
120
122
# https://github.com/eventlet/eventlet/issues/818
121
123
" module:please use dns.resolver.Resolver.resolve:DeprecationWarning" ,
122
124
# https://github.com/dateutil/dateutil/issues/1314
Original file line number Diff line number Diff line change @@ -25,14 +25,12 @@ class TestClientLoopSafety(unittest.TestCase):
25
25
def test_client_errors_on_different_loop (self ):
26
26
client = AsyncMongoClient ()
27
27
loop1 = asyncio .new_event_loop ()
28
- loop1 .run_until_complete (client .admin . command ( "ping" ))
28
+ loop1 .run_until_complete (client .aconnect ( ))
29
29
loop2 = asyncio .new_event_loop ()
30
30
with self .assertRaisesRegex (
31
31
RuntimeError , "Cannot use AsyncMongoClient in different event loop"
32
32
):
33
- loop2 .run_until_complete (client .admin . command ( "ping" ))
33
+ loop2 .run_until_complete (client .aconnect ( ))
34
34
loop1 .run_until_complete (client .close ())
35
35
loop1 .close ()
36
36
loop2 .close ()
37
- assert loop1 .is_closed ()
38
- assert loop2 .is_closed ()
You can’t perform that action at this time.
0 commit comments