Skip to content

Commit e51c3b5

Browse files
committed
skip some tempfile tests on macos
1 parent a948d6f commit e51c3b5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_tempfile.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ setUp () {
2121
}
2222

2323
test_tempfile () {
24+
if [ "$(uname)" = "Darwin" ]; then
25+
# macOS doesn't seem to allow controlling where mktemp creates
26+
# the output files
27+
return 0
28+
fi
2429
filename=$(virtualenvwrapper_tempfile hook)
2530
assertTrue "Filename is empty" "[ ! -z \"$filename\" ]"
2631
assertTrue "File doesn't exist" "[ -f \"$filename\" ]"
@@ -52,6 +57,11 @@ test_bad_mktemp() {
5257
}
5358

5459
test_no_such_tmpdir () {
60+
if [ "$(uname)" = "Darwin" ]; then
61+
# macOS doesn't seem to allow controlling where mktemp creates
62+
# the output files
63+
return 0
64+
fi
5565
old_tmpdir="$TMPDIR"
5666
export TMPDIR="$TMPDIR/does-not-exist"
5767
virtualenvwrapper_run_hook "initialize" >/dev/null 2>&1
@@ -61,6 +71,11 @@ test_no_such_tmpdir () {
6171
}
6272

6373
test_tmpdir_not_writable () {
74+
if [ "$(uname)" = "Darwin" ]; then
75+
# macOS doesn't seem to allow controlling where mktemp creates
76+
# the output files
77+
return 0
78+
fi
6479
old_tmpdir="$TMPDIR"
6580
export TMPDIR="$TMPDIR/cannot-write"
6681
mkdir "$TMPDIR"

0 commit comments

Comments
 (0)