Skip to content

Commit b290f7b

Browse files
authored
PYTHON-3526 Fix mockup tests (#1119)
1 parent 3ab7390 commit b290f7b

7 files changed

+7
-14
lines changed

test/mockupdb/test_mixed_version_sharded.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
from queue import Queue
2020

2121
from mockupdb import MockupDB, go
22+
from operations import upgrades # type: ignore[import]
2223

2324
from pymongo import MongoClient
2425

25-
from .operations import upgrades
26-
2726

2827
class TestMixedVersionSharded(unittest.TestCase):
2928
def setup_server(self, upgrade):

test/mockupdb/test_mongos_command_read_mode.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import unittest
1717

1818
from mockupdb import MockupDB, OpMsg, going
19+
from operations import operations # type: ignore[import]
1920

2021
from pymongo import MongoClient, ReadPreference
2122
from pymongo.read_preferences import (
@@ -24,8 +25,6 @@
2425
read_pref_mode_from_name,
2526
)
2627

27-
from .operations import operations
28-
2928

3029
class TestMongosCommandReadMode(unittest.TestCase):
3130
def test_aggregate(self):

test/mockupdb/test_op_msg_read_preference.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import Any
1919

2020
from mockupdb import CommandBase, MockupDB, going
21+
from operations import operations # type: ignore[import]
2122

2223
from pymongo import MongoClient, ReadPreference
2324
from pymongo.read_preferences import (
@@ -26,8 +27,6 @@
2627
read_pref_mode_from_name,
2728
)
2829

29-
from .operations import operations
30-
3130

3231
class OpMsgReadPrefBase(unittest.TestCase):
3332
single_mongod = False

test/mockupdb/test_reset_and_request_check.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
import unittest
1818

1919
from mockupdb import MockupDB, going, wait_until
20+
from operations import operations # type: ignore[import]
2021

2122
from pymongo import MongoClient
2223
from pymongo.errors import ConnectionFailure
2324
from pymongo.server_type import SERVER_TYPE
2425

25-
from .operations import operations
26-
2726

2827
class TestResetAndRequestCheck(unittest.TestCase):
2928
def __init__(self, *args, **kwargs):

test/mockupdb/test_slave_okay_rs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
import unittest
2121

2222
from mockupdb import MockupDB, going
23+
from operations import operations # type: ignore[import]
2324

2425
from pymongo import MongoClient
2526

26-
from .operations import operations
27-
2827

2928
class TestSlaveOkayRS(unittest.TestCase):
3029
def setup_server(self):

test/mockupdb/test_slave_okay_sharded.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
from queue import Queue
2424

2525
from mockupdb import MockupDB, going
26+
from operations import operations # type: ignore[import]
2627

2728
from pymongo import MongoClient
2829
from pymongo.read_preferences import make_read_preference, read_pref_mode_from_name
2930

30-
from .operations import operations
31-
3231

3332
class TestSlaveOkaySharded(unittest.TestCase):
3433
def setup_server(self):

test/mockupdb/test_slave_okay_single.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
import unittest
2424

2525
from mockupdb import MockupDB, going
26+
from operations import operations # type: ignore[import]
2627

2728
from pymongo import MongoClient
2829
from pymongo.read_preferences import make_read_preference, read_pref_mode_from_name
2930
from pymongo.topology_description import TOPOLOGY_TYPE
3031

31-
from .operations import operations
32-
3332

3433
def topology_type_name(client):
3534
topology_type = client._topology._description.topology_type

0 commit comments

Comments
 (0)