[v4.13] PYTHON-5406 - Use correct client for test (#2378)
Co-authored-by: Noah Stapp <noah.stapp@mongodb.com>
This commit is contained in:
parent
386d1afcb5
commit
5f800da807
@ -27,17 +27,15 @@ from test.asynchronous import AsyncIntegrationTest
|
||||
|
||||
class TestAsyncContextVarsReset(AsyncIntegrationTest):
|
||||
async def test_context_vars_are_reset_in_executor(self):
|
||||
if sys.version_info < (3, 11):
|
||||
self.skipTest("Test requires asyncio.Task.get_context (added in Python 3.11)")
|
||||
if sys.version_info < (3, 12):
|
||||
self.skipTest("Test requires asyncio.Task.get_context (added in Python 3.12)")
|
||||
|
||||
client = self.simple_client()
|
||||
|
||||
await client.db.test.insert_one({"x": 1})
|
||||
for server in client._topology._servers.values():
|
||||
await self.client.db.test.insert_one({"x": 1})
|
||||
for server in self.client._topology._servers.values():
|
||||
for context in [
|
||||
c
|
||||
for c in server._monitor._executor._task.get_context()
|
||||
if c.name in ["TIMEOUT", "RTT", "DEADLINE"]
|
||||
]:
|
||||
self.assertIn(context.get(), [None, float("inf"), 0.0])
|
||||
await client.db.test.delete_many({})
|
||||
await self.client.db.test.delete_many({})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user