Clear out ~/.other-path/ in tests since it wasn't getting cleared, which meant retries were guaranteed to fail for this function

This commit is contained in:
David Dworken 2023-09-06 20:13:36 -07:00
parent c5bdee9ad5
commit d80afc27d4
No known key found for this signature in database

View File

@ -1196,7 +1196,14 @@ echo other`)
func TestInstallViaPythonScriptWithCustomHishtoryPath(t *testing.T) {
defer testutils.BackupAndRestore(t)()
defer testutils.BackupAndRestoreEnv("HISHTORY_PATH")()
os.Setenv("HISHTORY_PATH", ".other-path")
altHishtoryPath := ".other-path"
os.Setenv("HISHTORY_PATH", altHishtoryPath)
// Make sure ~/$HISHTORY_PATH/ is also cleared out and empty
homedir, err := os.UserHomeDir()
require.NoError(t, err)
require.NoError(t, os.RemoveAll(path.Join(homedir, altHishtoryPath)))
testInstallViaPythonScriptChild(t, bashTester{})
}