def METHOD_NAME(tmpdir, undo_config_dir_patch, monkeypatch):
    # Try to set a manual one (already created)
    tmp_config_dir = tmpdir.mkdir("sunpy_test_configdir")
    monkeypatch.setenv("SUNPY_CONFIGDIR", tmp_config_dir.strpath)
    assert tmp_config_dir == _get_user_configdir()
    # Create a new config file
    copy_default_config()
    # Without the `overwrite` parameter
    # the function should raise an error.
    with pytest.warns(SunpyUserWarning):
        copy_default_config()