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 = [
117117 " module:unclosed <ssl.SSLSocket:ResourceWarning" ,
118118 " module:unclosed <socket object:ResourceWarning" ,
119119 " module:unclosed transport:ResourceWarning" ,
120+ # pytest-asyncio known issue: https://github.com/pytest-dev/pytest-asyncio/issues/724
121+ " module:unclosed event loop:ResourceWarning" ,
120122 # https://github.com/eventlet/eventlet/issues/818
121123 " module:please use dns.resolver.Resolver.resolve:DeprecationWarning" ,
122124 # 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):
2525 def test_client_errors_on_different_loop (self ):
2626 client = AsyncMongoClient ()
2727 loop1 = asyncio .new_event_loop ()
28- loop1 .run_until_complete (client .admin . command ( "ping" ))
28+ loop1 .run_until_complete (client .aconnect ( ))
2929 loop2 = asyncio .new_event_loop ()
3030 with self .assertRaisesRegex (
3131 RuntimeError , "Cannot use AsyncMongoClient in different event loop"
3232 ):
33- loop2 .run_until_complete (client .admin . command ( "ping" ))
33+ loop2 .run_until_complete (client .aconnect ( ))
3434 loop1 .run_until_complete (client .close ())
3535 loop1 .close ()
3636 loop2 .close ()
37- assert loop1 .is_closed ()
38- assert loop2 .is_closed ()
You can’t perform that action at this time.
0 commit comments