Skip to content

Commit 9c00d54

Browse files
committed
PYTHON-4580 Fix tests
1 parent db5cee8 commit 9c00d54

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

test/asynchronous/unified_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class UnifiedSpecTestMixinV1(AsyncIntegrationTest):
439439
a class attribute ``TEST_SPEC``.
440440
"""
441441

442-
SCHEMA_VERSION = Version.from_string("1.21")
442+
SCHEMA_VERSION = Version.from_string("1.22")
443443
RUN_ON_LOAD_BALANCER = True
444444
RUN_ON_SERVERLESS = True
445445
TEST_SPEC: Any

test/asynchronous/utils_spec_runner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import asyncio
1919
import functools
2020
import os
21+
import time
2122
import unittest
2223
from asyncio import iscoroutinefunction
2324
from collections import abc
@@ -314,6 +315,10 @@ async def assert_index_not_exists(self, database, collection, index):
314315
coll = self.client[database][collection]
315316
self.assertNotIn(index, [doc["name"] async for doc in await coll.list_indexes()])
316317

318+
async def wait(self, spec):
319+
"""Run the "wait" test operation."""
320+
await asyncio.sleep(spec["ms"] / 1000.0)
321+
317322
def assertErrorLabelsContain(self, exc, expected_labels):
318323
labels = [l for l in expected_labels if exc.has_error_label(l)]
319324
self.assertEqual(labels, expected_labels)

test/unified_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class UnifiedSpecTestMixinV1(IntegrationTest):
438438
a class attribute ``TEST_SPEC``.
439439
"""
440440

441-
SCHEMA_VERSION = Version.from_string("1.21")
441+
SCHEMA_VERSION = Version.from_string("1.22")
442442
RUN_ON_LOAD_BALANCER = True
443443
RUN_ON_SERVERLESS = True
444444
TEST_SPEC: Any

test/utils_spec_runner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import asyncio
1919
import functools
2020
import os
21+
import time
2122
import unittest
2223
from asyncio import iscoroutinefunction
2324
from collections import abc
@@ -314,6 +315,10 @@ def assert_index_not_exists(self, database, collection, index):
314315
coll = self.client[database][collection]
315316
self.assertNotIn(index, [doc["name"] for doc in coll.list_indexes()])
316317

318+
def wait(self, spec):
319+
"""Run the "wait" test operation."""
320+
time.sleep(spec["ms"] / 1000.0)
321+
317322
def assertErrorLabelsContain(self, exc, expected_labels):
318323
labels = [l for l in expected_labels if exc.has_error_label(l)]
319324
self.assertEqual(labels, expected_labels)

0 commit comments

Comments
 (0)