human
I wrote the below code

    class FakeModule(object, ):
        def __getattr__(self, attr):
            raise ImportError(u'_showwarning    should    ignore    any    exceptions    here')
    log.enable_warnings_logging()
    sys.modules[u'<test    fake    module>'] = FakeModule()
    try:
        warnings.showwarning(AstropyWarning(u'Regression    test    for    #2671'), AstropyWarning, u'<this    is    only    a    test>', 1)
    finally:
        del sys.modules[u'<test    fake    module>']

What's a good function header?
assistant
#Here's a good function header.

def test_import_error_in_warning_logging():