File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import ensurepip
99import os
1010import os .path
11+ import re
1112import struct
1213import subprocess
1314import 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.
You can’t perform that action at this time.
0 commit comments