def METHOD_NAME(temp_dir, home_dir, monkeypatch):
    home_path = os.path.join(temp_dir.name, home_dir)
    monkeypatch.setenv("USERPROFILE", home_path)  # for windows
    monkeypatch.setenv("HOME", home_path)  # for *nix