Skip to content

Commit 1a90e47

Browse files
authored
PYTHON-3131 Test Failure - test_mypy on macos + auth (#875)
1 parent 7a8f6b3 commit 1a90e47

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

test/test_mypy.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
except ImportError:
2626
api = None
2727

28+
from test import IntegrationTest
29+
2830
from bson.son import SON
2931
from pymongo.collection import Collection
30-
from pymongo.errors import ServerSelectionTimeoutError
31-
from pymongo.mongo_client import MongoClient
3232
from pymongo.operations import InsertOne
3333

3434
TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "mypy_fails")
@@ -53,22 +53,13 @@ def test_mypy_failures(self) -> None:
5353
self.ensure_mypy_fails(filename)
5454

5555

56-
class TestPymongo(unittest.TestCase):
57-
client: MongoClient
56+
class TestPymongo(IntegrationTest):
5857
coll: Collection
5958

6059
@classmethod
61-
def setUpClass(cls) -> None:
62-
cls.client = MongoClient(serverSelectionTimeoutMS=250, directConnection=False)
60+
def setUpClass(cls):
61+
super().setUpClass()
6362
cls.coll = cls.client.test.test
64-
try:
65-
cls.client.admin.command("ping")
66-
except ServerSelectionTimeoutError as exc:
67-
raise unittest.SkipTest(f"Could not connect to MongoDB: {exc}")
68-
69-
@classmethod
70-
def tearDownClass(cls) -> None:
71-
cls.client.close()
7263

7364
def test_insert_find(self) -> None:
7465
doc = {"my": "doc"}

0 commit comments

Comments
 (0)