Skip to content

Commit 804b3c9

Browse files
committed
test(unit_load): Delete files we create in fixture
On macOS we need sudo to delete them, maybe because they were created by a different prcoess?
1 parent 78775e0 commit 804b3c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/t/unit/test_unit_load.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23

34
import pytest
45

@@ -33,7 +34,10 @@ def fixture_dir(self, request, bash):
3334
assert_bash_exec(
3435
bash, "ln -sf ../prefix1/sbin/cmd2 %s/bin/cmd2" % tmpdir
3536
)
36-
return str(tmpdir)
37+
yield str(tmpdir)
38+
if sys.platform == "darwin":
39+
assert_bash_exec(bash, "sudo rm -rf %s/*" % tmpdir)
40+
assert_bash_exec(bash, "rm -rf %s/*" % tmpdir)
3741

3842
def test_userdir_1(self, bash, fixture_dir):
3943
with bash_env_saved(bash) as bash_env:

0 commit comments

Comments
 (0)