@@ -580,7 +580,7 @@ def _create_entity(self, entity_spec, uri=None):
580580 return
581581 elif entity_type == "database" :
582582 client = self [spec ["client" ]]
583- if not isinstance (client , MongoClient ) :
583+ if type (client ). __name__ != " MongoClient" :
584584 self .test .fail (
585585 "Expected entity {} to be of type MongoClient, got {}" .format (
586586 spec ["client" ], type (client )
@@ -602,7 +602,7 @@ def _create_entity(self, entity_spec, uri=None):
602602 return
603603 elif entity_type == "session" :
604604 client = self [spec ["client" ]]
605- if not isinstance (client , MongoClient ) :
605+ if type (client ). __name__ != " MongoClient" :
606606 self .test .fail (
607607 "Expected entity {} to be of type MongoClient, got {}" .format (
608608 spec ["client" ], type (client )
@@ -667,7 +667,7 @@ def create_entities_from_spec(self, entity_spec, uri=None):
667667
668668 def get_listener_for_client (self , client_name : str ) -> EventListenerUtil :
669669 client = self [client_name ]
670- if not isinstance (client , MongoClient ) :
670+ if type (client ). __name__ != " MongoClient" :
671671 self .test .fail (
672672 f"Expected entity { client_name } to be of type MongoClient, got { type (client )} "
673673 )
0 commit comments