MOTOR-1453 & MOTOR-1454 Update expected attributes tests and links (#331)

This commit is contained in:
Steven Silvester 2025-04-17 09:51:55 -05:00 committed by GitHub
parent eae1d25c5b
commit d5d0995776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 8 deletions

View File

@ -413,7 +413,7 @@ custom types to BSON, the :class:`~bson.codec_options.TypeCodec` and
:class:`~bson.codec_options.TypeRegistry` APIs may be a suitable alternative.
For more information, see the `Custom Types documentation`_.
.. _Custom Types documentation: https://www.mongodb.com/docs/languages/python/pymongo-driver/current/data-formats/custom-types/#std-label-pymongo-custom-types
.. _Custom Types documentation: https://www.mongodb.com/docs/languages/python/pymongo-driver/current/data-formats/custom-types/type-codecs/
GridFS changes
--------------

View File

@ -79,7 +79,7 @@ Use `the PyMongo compatibility matrix`_ to determine what MongoDB version is
supported by PyMongo. Use the compatibility matrix above to determine what
MongoDB version Motor supports.
.. _the PyMongo compatibility matrix: https://mongodb.com/docs/drivers/pymongo#compatibility
.. _the PyMongo compatibility matrix: https://www.mongodb.com/docs/languages/python/pymongo-driver/current/reference/compatibility/
Motor and Tornado
`````````````````

View File

@ -56,11 +56,11 @@ from pymongo import (
saslprep,
server_selectors,
server_type,
srv_resolver,
ssl_support,
uri_parser,
write_concern,
)
from pymongo.synchronous import srv_resolver
# Added for API compat with pymongo.
try:
@ -104,7 +104,6 @@ from pymongo.results import *
from pymongo.results import _WriteResult
from pymongo.saslprep import *
from pymongo.server_selectors import *
from pymongo.srv_resolver import _resolve, _SrvResolver
from pymongo.ssl_support import *
from pymongo.synchronous.client_session import _TxnState
from pymongo.synchronous.encryption import _Encrypter
@ -112,10 +111,10 @@ from pymongo.synchronous.monitor import *
from pymongo.synchronous.pool import _PoolClosedError
from pymongo.synchronous.server import *
from pymongo.synchronous.settings import *
from pymongo.synchronous.srv_resolver import _have_dnspython, _resolve, _SrvResolver
from pymongo.synchronous.topology import *
from pymongo.topology_description import *
from pymongo.uri_parser import *
from pymongo.uri_parser import _have_dnspython
from pymongo.write_concern import *
from tornado.ioloop import IOLoop

View File

@ -207,6 +207,16 @@ excluded_tests = [
# Motor does not allow calling to_list on a tailable cursor.
"TestCursor.test_max_await_time_ms",
"TestCursor.test_to_list_tailable",
# Newer tests not implemented in Motor
"TestClient.test_repr_srv_host",
"TestGridfs.test_delete_by_name",
"TestGridfs.test_rename_by_name",
"TestGridfsDeleteByName.*",
"TestGridfsRenameByName.*",
"TestMongosAndReadPreference.test_read_preference_hedge_deprecated",
"TestUnifiedTestFormatValidPassKmsProvidersExplicitKmsCredentials.*",
"TestUnifiedTestFormatValidPassKmsProvidersMixedKmsCredentialFields.*",
"TestUnifiedTestFormatValidPassKmsProvidersPlaceholderKmsCredentials.*",
]
@ -333,7 +343,7 @@ if __name__ == "__main__":
"pymongo.encryption_options",
"pymongo.mongo_client",
"pymongo.database",
"pymongo.srv_resolver",
"pymongo.synchronous.srv_resolver",
"pymongo.synchronous.collection",
"pymongo.synchronous.client_session",
"pymongo.synchronous.command_cursor",

View File

@ -31,9 +31,11 @@ motor_only = set(["delegate", "get_io_loop", "io_loop", "wrap"])
pymongo_only = set(["next"])
pymongo_gridfs_only = set(["delete_by_name", "rename_by_name"])
motor_client_only = motor_only.union(["open"])
pymongo_client_only = set([]).union(pymongo_only)
pymongo_client_only = set(["eq_props"]).union(pymongo_only)
pymongo_database_only = set([]).union(pymongo_only)
@ -113,7 +115,7 @@ class MotorCoreTestGridFS(MotorTest):
motor_gridfs_only = set(["collection"]).union(motor_only)
self.assertEqual(
attrs(GridFSBucket(env.sync_cx.test)),
attrs(GridFSBucket(env.sync_cx.test)) - pymongo_gridfs_only,
attrs(MotorGridFSBucket(self.cx.test)) - motor_gridfs_only,
)