@@ -482,6 +482,7 @@ async def insert_initial_data(self, initial_data):
482482 wc = WriteConcern (w = "majority" )
483483 else :
484484 wc = WriteConcern (w = 1 )
485+
485486 if documents :
486487 if opts :
487488 await db .create_collection (coll_name , ** opts )
@@ -490,6 +491,12 @@ async def insert_initial_data(self, initial_data):
490491 # Ensure collection exists
491492 await db .create_collection (coll_name , write_concern = wc , ** opts )
492493
494+ # Remove any encryption collections associated with the collection.
495+ collections = await db .list_collection_names ()
496+ for collection in collections :
497+ if collection in [f"nxcol_{ coll_name } .esc" , "enxcol_{coll_name}.ecoc" ]:
498+ await db .drop_collection (collection )
499+
493500 @classmethod
494501 def setUpClass (cls ) -> None :
495502 # Speed up the tests by decreasing the heartbeat frequency.
@@ -508,6 +515,7 @@ def tearDownClass(cls) -> None:
508515 async def asyncSetUp (self ):
509516 # super call creates internal client cls.client
510517 await super ().asyncSetUp ()
518+
511519 # process file-level runOnRequirements
512520 run_on_spec = self .TEST_SPEC .get ("runOnRequirements" , [])
513521 if not await self .should_run_on (run_on_spec ):
0 commit comments