File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class Movie(TypedDict): # type: ignore[misc]
47
47
from pymongo .collection import Collection
48
48
from pymongo .mongo_client import MongoClient
49
49
from pymongo .operations import InsertOne
50
+ from pymongo .read_preferences import ReadPreference
50
51
51
52
TEST_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "mypy_fails" )
52
53
@@ -163,6 +164,15 @@ class mydict(Dict[str, Any]):
163
164
)
164
165
self .assertTrue (len (list (result )))
165
166
167
+ def test_with_transaction (self ) -> None :
168
+ def execute_transaction (session ):
169
+ pass
170
+
171
+ with self .client .start_session () as session :
172
+ return session .with_transaction (
173
+ execute_transaction , read_preference = ReadPreference .PRIMARY
174
+ )
175
+
166
176
167
177
class TestDecode (unittest .TestCase ):
168
178
def test_bson_decode (self ) -> None :
You can’t perform that action at this time.
0 commit comments