human
I wrote the below code

    monkeypatch.setenv(str(u'XDG_CONFIG_HOME'), u'foo')
    monkeypatch.delenv(str(u'XDG_CONFIG_HOME'))
    monkeypatch.setattr(paths.set_temp_config, u'_temp_path', None)
    def osraiser(dirnm, linkto):
        raise OSError
    monkeypatch.setattr(paths, u'_find_or_create_astropy_dir', osraiser)
    monkeypatch.setattr(configuration, u'_cfgobjs', {})
    with pytest.raises(OSError):
        paths.get_config_dir()
    with catch_warnings(configuration.ConfigurationMissingWarning) as w:
        test_configitem()
    assert (len(w) == 1)
    w = w[0]
    assert (u'Configuration    defaults    will    be    used' in str(w.message))

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

def test_config_noastropy_fallback(monkeypatch):