'This raises an import error on load to test that it is handled correctly'

def test_import_error(self):

    with warnings.catch_warnings():
        warnings.filterwarnings(u'error')
        try:
            mock_entry_importerror = mock.create_autospec(EntryPoint)
            mock_entry_importerror.name = u'IErr'
            mock_entry_importerror.load = self.raiseimporterror
            populate_entry_points([mock_entry_importerror])
        except AstropyUserWarning as w:
            if (u'ImportError' in w.args[0]):
                pass
            else:
                raise w
        else:
            raise self.exception_not_thrown
