File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 25
25
except ImportError :
26
26
api = None
27
27
28
+ from test import IntegrationTest
29
+
28
30
from bson .son import SON
29
31
from pymongo .collection import Collection
30
- from pymongo .errors import ServerSelectionTimeoutError
31
- from pymongo .mongo_client import MongoClient
32
32
from pymongo .operations import InsertOne
33
33
34
34
TEST_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "mypy_fails" )
@@ -53,22 +53,13 @@ def test_mypy_failures(self) -> None:
53
53
self .ensure_mypy_fails (filename )
54
54
55
55
56
- class TestPymongo (unittest .TestCase ):
57
- client : MongoClient
56
+ class TestPymongo (IntegrationTest ):
58
57
coll : Collection
59
58
60
59
@classmethod
61
- def setUpClass (cls ) -> None :
62
- cls . client = MongoClient ( serverSelectionTimeoutMS = 250 , directConnection = False )
60
+ def setUpClass (cls ):
61
+ super (). setUpClass ( )
63
62
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 ()
72
63
73
64
def test_insert_find (self ) -> None :
74
65
doc = {"my" : "doc" }
You can’t perform that action at this time.
0 commit comments