We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61f586e commit 67d15e5Copy full SHA for 67d15e5
test/asynchronous/test_async_loop_safety.py
@@ -25,12 +25,14 @@ class TestClientLoopSafety(unittest.TestCase):
25
def test_client_errors_on_different_loop(self):
26
client = AsyncMongoClient()
27
loop1 = asyncio.new_event_loop()
28
- loop1.run_until_complete(client.server_info())
+ loop1.run_until_complete(client.admin.command("ping"))
29
loop2 = asyncio.new_event_loop()
30
with self.assertRaisesRegex(
31
RuntimeError, "Cannot use AsyncMongoClient in different event loop"
32
):
33
- loop2.run_until_complete(client.server_info())
+ loop2.run_until_complete(client.admin.command("ping"))
34
loop1.run_until_complete(client.close())
35
loop1.close()
36
loop2.close()
37
+ assert loop1.is_closed()
38
+ assert loop2.is_closed()
0 commit comments