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]
4747from pymongo .collection import Collection
4848from pymongo .mongo_client import MongoClient
4949from pymongo .operations import InsertOne
50+ from pymongo .read_preferences import ReadPreference
5051
5152TEST_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "mypy_fails" )
5253
@@ -163,6 +164,15 @@ class mydict(Dict[str, Any]):
163164 )
164165 self .assertTrue (len (list (result )))
165166
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+
166176
167177class TestDecode (unittest .TestCase ):
168178 def test_bson_decode (self ) -> None :
You can’t perform that action at this time.
0 commit comments