@@ -580,7 +580,7 @@ def _create_entity(self, entity_spec, uri=None):
580
580
return
581
581
elif entity_type == "database" :
582
582
client = self [spec ["client" ]]
583
- if not isinstance (client , MongoClient ) :
583
+ if type (client ). __name__ != " MongoClient" :
584
584
self .test .fail (
585
585
"Expected entity {} to be of type MongoClient, got {}" .format (
586
586
spec ["client" ], type (client )
@@ -602,7 +602,7 @@ def _create_entity(self, entity_spec, uri=None):
602
602
return
603
603
elif entity_type == "session" :
604
604
client = self [spec ["client" ]]
605
- if not isinstance (client , MongoClient ) :
605
+ if type (client ). __name__ != " MongoClient" :
606
606
self .test .fail (
607
607
"Expected entity {} to be of type MongoClient, got {}" .format (
608
608
spec ["client" ], type (client )
@@ -667,7 +667,7 @@ def create_entities_from_spec(self, entity_spec, uri=None):
667
667
668
668
def get_listener_for_client (self , client_name : str ) -> EventListenerUtil :
669
669
client = self [client_name ]
670
- if not isinstance (client , MongoClient ) :
670
+ if type (client ). __name__ != " MongoClient" :
671
671
self .test .fail (
672
672
f"Expected entity { client_name } to be of type MongoClient, got { type (client )} "
673
673
)
0 commit comments