@@ -549,13 +549,6 @@ def setUpClass(cls):
549
549
if cls .TEST_SPEC ['description' ].find ('retryable-writes' ) != - 1 :
550
550
raise unittest .SkipTest (
551
551
"MMAPv1 does not support retryWrites=True" )
552
- if cls .TEST_SPEC ['description' ].find ('change-streams' ) != - 1 :
553
- raise unittest .SkipTest (
554
- "MMAPv1 does not support change streams" )
555
- if cls .TEST_SPEC ['description' ].find (
556
- 'transactions-convenient-api' ) != - 1 :
557
- raise unittest .SkipTest (
558
- "MMAPv1 does not support document-level locking" )
559
552
560
553
@classmethod
561
554
def tearDownClass (cls ):
@@ -643,6 +636,8 @@ def __raise_if_unsupported(self, opname, target, *target_types):
643
636
'of type %s' % (opname , type (target )))
644
637
645
638
def __entityOperation_createChangeStream (self , target , * args , ** kwargs ):
639
+ if client_context .storage_engine == 'mmapv1' :
640
+ self .skipTest ("MMAPv1 does not support change streams" )
646
641
self .__raise_if_unsupported (
647
642
'createChangeStream' , target , MongoClient , Database , Collection )
648
643
return target .watch (* args , ** kwargs )
@@ -702,9 +697,17 @@ def _collectionOperation_insertOne(self, target, *args, **kwargs):
702
697
return {'insertedId' : result .inserted_id }
703
698
704
699
def _sessionOperation_withTransaction (self , target , * args , ** kwargs ):
700
+ if client_context .storage_engine == 'mmapv1' :
701
+ self .skipTest ('MMAPv1 does not support document-level locking' )
705
702
self .__raise_if_unsupported ('withTransaction' , target , ClientSession )
706
703
return target .with_transaction (* args , ** kwargs )
707
704
705
+ def _sessionOperation_startTransaction (self , target , * args , ** kwargs ):
706
+ if client_context .storage_engine == 'mmapv1' :
707
+ self .skipTest ('MMAPv1 does not support document-level locking' )
708
+ self .__raise_if_unsupported ('startTransaction' , target , ClientSession )
709
+ return target .start_transaction (* args , ** kwargs )
710
+
708
711
def _changeStreamOperation_iterateUntilDocumentOrError (self , target ,
709
712
* args , ** kwargs ):
710
713
self .__raise_if_unsupported (
0 commit comments