Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87d6e13

Browse files
committed
Fix test_venv on FreeBSD buildbot
Ignore pip warning in test_venv.test_with_venv().
1 parent 21d0e1b commit 87d6e13

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Lib/test/test_venv.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import ensurepip
99
import os
1010
import os.path
11+
import re
1112
import struct
1213
import subprocess
1314
import sys
@@ -394,7 +395,15 @@ def test_with_pip(self):
394395
# We force everything to text, so unittest gives the detailed diff
395396
# if we get unexpected results
396397
err = err.decode("latin-1") # Force to text, prevent decoding errors
397-
self.assertEqual(err, "")
398+
# Ignore the warning:
399+
# "The directory '$HOME/.cache/pip/http' or its parent directory
400+
# is not owned by the current user and the cache has been disabled.
401+
# Please check the permissions and owner of that directory. If
402+
# executing pip with sudo, you may want sudo's -H flag."
403+
# where $HOME is replaced by the HOME environment variable.
404+
err = re.sub("^The directory .* or its parent directory is not owned "
405+
"by the current user .*$", "", err, flags=re.MULTILINE)
406+
self.assertEqual(err.rstrip(), "")
398407
# Being fairly specific regarding the expected behaviour for the
399408
# initial bundling phase in Python 3.4. If the output changes in
400409
# future pip versions, this test can likely be relaxed further.

0 commit comments

Comments
 (0)