Skip to content

Commit 5ba67d6

Browse files
committed
PYTHON-2838 Skip getlasterror test on >=5.0
(cherry picked from commit c93194a)
1 parent 9c9a560 commit 5ba67d6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/test_collection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,7 @@ def test_acknowledged_delete(self):
15861586
self.assertEqual(2, db.test.delete_many({}).deleted_count)
15871587
self.assertEqual(0, db.test.delete_many({}).deleted_count)
15881588

1589+
@client_context.require_version_max(4, 9)
15891590
def test_manual_last_error(self):
15901591
coll = self.db.get_collection("test", write_concern=WriteConcern(w=0))
15911592
coll.insert_one({"x": 1})

test/test_legacy_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,13 @@ def test_group_uuid_representation(self):
10271027
coll.group([], {"_id": uu},
10281028
{"count": 0}, reduce))
10291029

1030+
@client_context.require_version_max(5, 0, 99)
10301031
def test_last_status(self):
1032+
# Skip versions like "v5.0.0-alpha0-1768-gfda1dfa" which equals:
1033+
# Version(5, 0, 1, -1)
1034+
if (client_context.version[:2] == (5, 0) and
1035+
client_context.version[-1] == -1):
1036+
self.skipTest('getLastError is not supported')
10311037
# Tests many legacy API elements.
10321038
# We must call getlasterror on same socket as the last operation.
10331039
db = rs_or_single_client(maxPoolSize=1).pymongo_test

0 commit comments

Comments
 (0)