Skip to content

Commit f120408

Browse files
authored
ignore failed destroy command if there's no environment (#96)
1 parent edf298a commit f120408

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_vagrant.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ def fixture_test_dir() -> Generator[str, None, None]:
7777
# Removes the directory created initially, runs once after the last test
7878
sys.stderr.write("module teardown()\n")
7979
if my_dir is not None:
80-
subprocess.check_call("vagrant destroy -f", cwd=my_dir, shell=True)
80+
try:
81+
subprocess.check_call("vagrant destroy -f", cwd=my_dir, shell=True)
82+
except subprocess.CalledProcessError:
83+
pass
84+
8185
shutil.rmtree(my_dir)
8286

8387

0 commit comments

Comments
 (0)