From d2b215f4d54e46d2c2cd09122286248996654bc5 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Tue, 16 Jun 2020 14:11:08 -0400 Subject: [PATCH] command: Fix test cleanup This test runs `init`, which causes some dangling `.terraform` state after running tests. --- command/import_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/command/import_test.go b/command/import_test.go index 11ba76f043..d70e685047 100644 --- a/command/import_test.go +++ b/command/import_test.go @@ -745,7 +745,10 @@ func TestImport_missingModuleConfig(t *testing.T) { } func TestImportModuleVarFile(t *testing.T) { - defer testChdir(t, testFixturePath("import-module-var-file"))() + td := tempDir(t) + copy.CopyDir(testFixturePath("import-module-var-file"), td) + defer os.RemoveAll(td) + defer testChdir(t, td)() statePath := testTempFile(t)