@@ -472,8 +472,23 @@ def sanity_check_step(self, *args, **kwargs):
472472
473473 # run sanity checks for specific components
474474 cnt = len (self .comp_cfgs_sanity_check )
475- for idx , comp in enumerate (self .comp_cfgs_sanity_check ):
476- print_msg ("sanity checking bundle component %s v%s (%i/%i)..." , comp .name , comp .version , idx + 1 , cnt )
477- self .log .info ("Starting sanity check step for component %s v%s" , comp .name , comp .version )
478-
479- comp .run_step ('sanity_check' , [lambda x : x .sanity_check_step ])
475+ if cnt > 0 :
476+ if self .sanity_check_module_loaded :
477+ loaded_module = False
478+ else :
479+ self .sanity_check_load_module (extension = kwargs .get ('extension' , False ),
480+ extra_modules = kwargs .get ('extra_modules' , None ))
481+ loaded_module = self .sanity_check_module_loaded
482+ for idx , comp in enumerate (self .comp_cfgs_sanity_check ):
483+ print_msg ("sanity checking bundle component %s v%s (%i/%i)..." , comp .name , comp .version , idx + 1 , cnt )
484+ self .log .info ("Starting sanity check step for component %s v%s" , comp .name , comp .version )
485+
486+ # Avoid loading the module in components again
487+ comp .sanity_check_module_loaded = True
488+ comp .run_step ('sanity_check' , [lambda x : x .sanity_check_step ])
489+ comp .sanity_check_module_loaded = False
490+ if loaded_module :
491+ if self .fake_mod_data :
492+ self .clean_up_fake_module (self .fake_mod_data )
493+ self .fake_mod_data = None
494+ self .sanity_check_module_loaded = False
0 commit comments