'Make sure exceptions are not silenced since this step is prior to
setup logging.'

def test_import_default_modules_with_exception(self):

    def trigger_exception(**kwargs):
        raise ImportError(u'Dummy    ImportError')
    from celery.signals import import_modules
    import_modules.connect(trigger_exception)
    self.app.conf.imports = (u'os', u'sys')
    with pytest.raises(ImportError):
        self.loader.import_default_modules()
