Skip to content

Commit 2a9225d

Browse files
authored
MOTOR-1363 - Pass correct parameter to AsyncIOMotorClientEncryption (#305)
1 parent 7050d54 commit 2a9225d

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ filterwarnings = [
103103
"ignore:GridOut property 'aliases' is deprecated and will be removed in PyMongo 5.0:DeprecationWarning",
104104
# From older versions aiohttp.
105105
"ignore:\"@coroutine\" decorator is deprecated since Python 3.8:DeprecationWarning",
106-
"ignore:The loop argument is deprecated since Python 3.8:DeprecationWarning"
106+
"ignore:The loop argument is deprecated since Python 3.8:DeprecationWarning",
107+
# TODO: Remove both of these in https://jira.mongodb.org/browse/PYTHON-4731
108+
"ignore:Unclosed AsyncMongoClient*",
109+
"ignore:Unclosed MongoClient*",
107110
]
108111

109112
[tool.ruff]

synchro/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
from pymongo.monitoring import _LISTENERS, _Listeners
9494
from pymongo.ocsp_cache import _OCSPCache
9595
from pymongo.operations import *
96+
from pymongo.pool import *
97+
from pymongo.pool import Connection, Pool
9698
from pymongo.read_concern import *
9799
from pymongo.read_preferences import *
98100
from pymongo.read_preferences import _ServerMode
@@ -107,8 +109,7 @@
107109
from pymongo.synchronous.monitor import *
108110
from pymongo.synchronous.periodic_executor import *
109111
from pymongo.synchronous.periodic_executor import _EXECUTORS
110-
from pymongo.synchronous.pool import *
111-
from pymongo.synchronous.pool import Connection, Pool, _PoolClosedError
112+
from pymongo.synchronous.pool import _PoolClosedError
112113
from pymongo.synchronous.server import *
113114
from pymongo.synchronous.settings import *
114115
from pymongo.synchronous.topology import *

test/asyncio_tests/test_asyncio_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_sub_collection(self):
270270
@env.require_no_standalone
271271
@asyncio_test
272272
async def test_async_create_encrypted_collection(self):
273-
c = self.collection
273+
c = self.cx
274274
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
275275
self.cx.drop_database("db")
276276
async with AsyncIOMotorClientEncryption(
@@ -290,7 +290,7 @@ async def test_async_create_encrypted_collection(self):
290290
@env.require_version_min(8, 0, -1, -1)
291291
@asyncio_test
292292
async def test_async_encrypt_expression(self):
293-
c = self.collection
293+
c = self.cx
294294
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
295295
self.cx.drop_database("db")
296296
async with AsyncIOMotorClientEncryption(

test/asyncio_tests/test_asyncio_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ async def test_context_manager(self):
585585

586586
@asyncio_test
587587
async def test_generate_keys(self):
588-
c = self.collection
588+
c = self.cx
589589
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
590590

591591
async with motor_asyncio.AsyncIOMotorClientEncryption(

test/tornado_tests/test_motor_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_sub_collection(self):
272272
@gen_test
273273
async def test_async_create_encrypted_collection(self):
274274
await self.db.drop_collection("test_collection")
275-
c = self.collection
275+
c = self.cx
276276
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
277277
self.cx.drop_database("db")
278278
async with motor.MotorClientEncryption(
@@ -292,7 +292,7 @@ async def test_async_create_encrypted_collection(self):
292292
@env.require_version_min(8, 0, -1, -1)
293293
@gen_test
294294
async def test_async_encrypt_expression(self):
295-
c = self.collection
295+
c = self.cx
296296
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
297297
self.cx.drop_database("db")
298298
async with motor.MotorClientEncryption(

test/tornado_tests/test_motor_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ async def test_raw_batches(self):
518518

519519
@gen_test
520520
async def test_generate_keys(self):
521-
c = self.collection
521+
c = self.cx
522522
KMS_PROVIDERS = {"local": {"key": b"\x00" * 96}}
523523

524524
async with motor.MotorClientEncryption(

0 commit comments

Comments
 (0)