summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-06-14 13:59:44 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2015-06-14 13:59:44 +0200
commite0d3f5a654e83db58b04f189774eeb3a96cd8bd7 (patch)
tree7efa03d5bd62f920e485b8e759fe345016e592f1
parent8d66475bbeaa04aa6c4064ceadf0f4f176f5e03d (diff)
downloadpsutil-e0d3f5a654e83db58b04f189774eeb3a96cd8bd7.tar.gz
fix OSX test failure
-rw-r--r--Makefile7
-rw-r--r--test/test_psutil.py9
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index eaace20b..30597d7d 100644
--- a/Makefile
+++ b/Makefile
@@ -35,9 +35,10 @@ build: clean
# useful deps which are nice to have while developing / testing
setup-dev-env: install-git-hooks
- python -c "import urllib2; \
- r = urllib2.urlopen('https://bootstrap.pypa.io/get-pip.py'); \
- open('/tmp/get-pip.py', 'w').write(r.read());"
+ python -c "import urllib2, ssl; \
+ context = ssl._create_unverified_context(); \
+ r = urllib2.urlopen('https://bootstrap.pypa.io/get-pip.py', context=context); \
+ open('/tmp/get-pip.py', 'w').write(r.read());"
$(PYTHON) /tmp/get-pip.py --user
rm /tmp/get-pip.py
$(PYTHON) -m pip install --user --upgrade pip
diff --git a/test/test_psutil.py b/test/test_psutil.py
index 6b3bb029..3cf40121 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -3090,7 +3090,7 @@ class TestUnicode(unittest.TestCase):
def setUpClass(cls):
with tempfile.NamedTemporaryFile() as f:
tdir = os.path.dirname(f.name)
- cls.uexe = os.path.join(tdir, "psutil-è.exe")
+ cls.uexe = os.path.realpath(os.path.join(tdir, "psutil-è.exe"))
shutil.copyfile(sys.executable, cls.uexe)
if POSIX:
st = os.stat(cls.uexe)
@@ -3127,7 +3127,7 @@ class TestUnicode(unittest.TestCase):
self.assertEqual(p.cmdline(), [self.uexe])
def test_proc_cwd(self):
- tdir = tempfile.mkdtemp(prefix="psutil-è-")
+ tdir = os.path.realpath(tempfile.mkdtemp(prefix="psutil-è-"))
self.addCleanup(safe_rmdir, tdir)
with chdir(tdir):
p = psutil.Process()
@@ -3142,7 +3142,10 @@ class TestUnicode(unittest.TestCase):
new = set(p.open_files())
path = (new - start).pop().path
self.assertIsInstance(path, str)
- self.assertEqual(path.lower(), self.uexe.lower())
+ if WINDOWS:
+ self.assertEqual(path.lower(), self.uexe.lower())
+ else:
+ self.assertEqual(path, self.uexe)
def main():