Skip to content

Commit 0382efa

Browse files
committed
Switch out of directory before deleting it
1 parent 0c86c0c commit 0382efa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spin/tests/test_build_cmds.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def test_docs():
128128
def test_spin_install():
129129
cwd = os.getcwd()
130130
spin("install")
131-
try:
132-
with tempfile.TemporaryDirectory() as d:
131+
with tempfile.TemporaryDirectory() as d:
132+
try:
133133
os.chdir(d)
134134
p = run(
135135
[
@@ -140,9 +140,9 @@ def test_spin_install():
140140
stdout=subprocess.PIPE,
141141
)
142142
assert stdout(p) == "0.0.0dev0"
143-
finally:
144-
os.chdir(cwd)
145-
run(["pip", "uninstall", "-y", "--quiet", "example_pkg"])
143+
finally:
144+
os.chdir(cwd)
145+
run(["pip", "uninstall", "-y", "--quiet", "example_pkg"])
146146

147147

148148
@on_linux

0 commit comments

Comments
 (0)