Skip to content

Commit 4726c3c

Browse files
committed
Fix failures
1 parent 58ca6f0 commit 4726c3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+94
-190
lines changed

test/asynchronous/test_async_cancellation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
import asyncio
1919
import sys
20-
from test.utils_shared import async_get_pool, delay, one
20+
from test.asynchronous.utils import async_get_pool
21+
from test.utils_shared import delay, one
2122

2223
sys.path[0:0] = [""]
2324

test/asynchronous/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
)
6262
from test.asynchronous.pymongo_mocks import AsyncMockClient
6363
from test.asynchronous.utils import (
64-
AsyncFunctionCallRecorder,
6564
async_get_pool,
6665
async_wait_until,
6766
asyncAssertRaisesExactly,
@@ -70,6 +69,7 @@
7069
from test.utils_shared import (
7170
NTHREADS,
7271
CMAPListener,
72+
FunctionCallRecorder,
7373
delay,
7474
gevent_monkey_patched,
7575
is_greenthread_patched,
@@ -513,7 +513,7 @@ async def test_connection_timeout_ms_propagates_to_DNS_resolver(self):
513513
# Patch the resolver.
514514
from pymongo.srv_resolver import _resolve
515515

516-
patched_resolver = AsyncFunctionCallRecorder(_resolve)
516+
patched_resolver = FunctionCallRecorder(_resolve)
517517
pymongo.srv_resolver._resolve = patched_resolver
518518

519519
def reset_resolver():

test/asynchronous/test_collection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import sys
2222
from codecs import utf_8_decode
2323
from collections import defaultdict
24+
from test.asynchronous.utils import async_get_pool, async_is_mongos
2425
from typing import Any, Iterable, no_type_check
2526

2627
from pymongo.asynchronous.database import AsyncDatabase
@@ -37,8 +38,6 @@
3738
IMPOSSIBLE_WRITE_CONCERN,
3839
EventListener,
3940
OvertCommandListener,
40-
async_get_pool,
41-
async_is_mongos,
4241
async_wait_until,
4342
)
4443

test/asynchronous/test_connection_monitoring.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020
import sys
2121
import time
2222
from pathlib import Path
23+
from test.asynchronous.utils import async_get_pool, async_get_pools
2324

2425
sys.path[0:0] = [""]
2526

26-
from test.asynchronous import AsyncIntegrationTest, client_knobs, unittest
27+
from test.asynchronous import AsyncIntegrationTest, async_client_context, client_knobs, unittest
2728
from test.asynchronous.pymongo_mocks import DummyMonitor
2829
from test.asynchronous.utils_spec_runner import AsyncSpecTestCreator, SpecRunnerTask
2930
from test.utils_shared import (
3031
CMAPListener,
31-
async_client_context,
32-
async_get_pool,
33-
async_get_pools,
3432
async_wait_until,
3533
camel_to_snake,
3634
)

test/asynchronous/test_connections_survive_primary_stepdown_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
import sys
19+
from test.asynchronous.utils import async_ensure_all_connected
1920

2021
sys.path[0:0] = [""]
2122

@@ -27,7 +28,6 @@
2728
from test.asynchronous.helpers import async_repl_set_step_down
2829
from test.utils_shared import (
2930
CMAPListener,
30-
async_ensure_all_connected,
3131
)
3232

3333
from bson import SON

test/asynchronous/test_gridfs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
sys.path[0:0] = [""]
2929

3030
from test.asynchronous import AsyncIntegrationTest, async_client_context, unittest
31-
from test.utils_shared import async_joinall, one
31+
from test.asynchronous.utils import async_joinall
32+
from test.utils_shared import one
3233

3334
import gridfs
3435
from bson.binary import Binary

test/asynchronous/test_gridfs_bucket.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
sys.path[0:0] = [""]
3030

3131
from test.asynchronous import AsyncIntegrationTest, async_client_context, unittest
32-
from test.utils_shared import async_joinall, joinall, one
32+
from test.asynchronous.utils import async_joinall
33+
from test.utils_shared import one
3334

3435
import gridfs
3536
from bson.binary import Binary

test/asynchronous/test_heartbeat_monitoring.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
from __future__ import annotations
1717

1818
import sys
19+
from test.asynchronous.utils import AsyncMockPool
1920

2021
sys.path[0:0] = [""]
2122

2223
from test.asynchronous import AsyncIntegrationTest, client_knobs, unittest
23-
from test.utils_shared import AsyncMockPool, HeartbeatEventListener, async_wait_until
24+
from test.utils_shared import HeartbeatEventListener, async_wait_until
2425

2526
from pymongo.asynchronous.monitor import Monitor
2627
from pymongo.errors import ConnectionFailure

test/asynchronous/test_load_balancer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import threading
2424
from asyncio import Event
2525
from test.asynchronous.helpers import ConcurrentRunner, ExceptionCatchingTask
26+
from test.asynchronous.utils import async_get_pool
2627

2728
import pytest
2829

@@ -31,7 +32,6 @@
3132
from test.asynchronous import AsyncIntegrationTest, async_client_context, unittest
3233
from test.asynchronous.unified_format import generate_test_classes
3334
from test.utils_shared import (
34-
async_get_pool,
3535
async_wait_until,
3636
create_async_event,
3737
)

test/asynchronous/test_max_staleness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
sys.path[0:0] = [""]
2929

3030
from test.asynchronous import AsyncPyMongoTestCase, async_client_context, unittest
31-
from test.utils_shared_selection_tests import create_selection_tests
31+
from test.asynchronous.utils_selection_tests import create_selection_tests
3232

3333
from pymongo.errors import ConfigurationError
3434
from pymongo.server_selectors import writable_server_selector

0 commit comments

Comments
 (0)