              self.assertRaises(ImportError, import_module, 'egg_module.bad_module')
  
              # A child that doesn't exist
              self.assertFalse(module_has_submodule(egg_module, 'no_such_module'))
              self.assertRaises(ImportError, import_module, 'egg_module.no_such_module')
  
      def test_deep_loader(self):
          "Modules deep inside an egg can still be tested for existence"
          egg_name = '%s/test_egg.egg' % self.egg_dir
          with extend_sys_path(egg_name):
 
</s> remove             self.assertRaises(ImportError, import_module, 'egg_module.bad_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.bad_module') </s> remove             self.assertRaises(ImportError, import_module, 'egg_module.sub1.sub2.no_such_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.sub1.sub2.no_such_module') </s> remove             self.assertRaises(ImportError, import_module, 'egg_module.sub1.sub2.bad_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.sub1.sub2.bad_module') </s> remove         self.assertRaises(ImportError, import_module, 'utils_tests.test_module.no_such_module')
 </s> add         with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.no_such_module') </s> remove         self.assertRaises(ImportError, import_module, 'utils_tests.test_module.bad_module')
 </s> add         with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.bad_module')
            with self.assertRaises(ImportError):
                import_module('egg_module.no_such_module')
              self.assertRaises(ImportError, import_module, 'egg_module.bad_module')
  
              # A child that doesn't exist
              self.assertFalse(module_has_submodule(egg_module, 'no_such_module'))
            with self.assertRaises(ImportError):
                import_module('egg_module.no_such_module')
  
      def test_deep_loader(self):
          "Modules deep inside an egg can still be tested for existence"
          egg_name = '%s/test_egg.egg' % self.egg_dir
          with extend_sys_path(egg_name):
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/utils_tests/test_module_loading.py