def METHOD_NAME(tmp_path):
    pre_test_data_dir = ytcfg["yt", "test_data_dir"]
    ytcfg.set("yt", "test_data_dir", "/does/not/exist")
    origin = os.getcwd()
    os.chdir(tmp_path)
    yield
    ytcfg.set("yt", "test_data_dir", pre_test_data_dir)
    os.chdir(origin)