Skip to content

Commit 0279407

Browse files
authored
PYTHON-4806 Fix expected metadata in mockupdb tests (#1888)
1 parent 7fbeca9 commit 0279407

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: hatch.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ features = ["test"]
4343
test = "pytest -v --durations=5 --maxfail=10 {args}"
4444
test-eg = "bash ./.evergreen/run-tests.sh {args}"
4545
test-async = "pytest -v --durations=5 --maxfail=10 -m default_async {args}"
46-
test-mockupdb = ["pip install -U git+https://github.com/ajdavis/mongo-mockup-db@master", "test -m mockupdb"]
46+
test-mockupdb = ["pip install -U git+https://github.com/mongodb-labs/mongo-mockup-db@master", "test -m mockupdb"]
4747

4848
[envs.encryption]
4949
skip-install = true

Diff for: test/mockupdb/test_handshake.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
from bson.objectid import ObjectId
29-
from pymongo import MongoClient
29+
from pymongo import MongoClient, has_c
3030
from pymongo import version as pymongo_version
3131
from pymongo.errors import OperationFailure
3232
from pymongo.server_api import ServerApi, ServerApiVersion
@@ -39,7 +39,11 @@ def _check_handshake_data(request):
3939
data = request["client"]
4040

4141
assert data["application"] == {"name": "my app"}
42-
assert data["driver"] == {"name": "PyMongo", "version": pymongo_version}
42+
if has_c():
43+
name = "PyMongo|c"
44+
else:
45+
name = "PyMongo"
46+
assert data["driver"] == {"name": name, "version": pymongo_version}
4347

4448
# Keep it simple, just check these fields exist.
4549
assert "os" in data

0 commit comments

Comments
 (0)