diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-11 19:55:28 +0000 |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-11 19:55:28 +0000 |
commit | b3f10de5f035cdd7093f688f5add7a857f9b7a85 (patch) | |
tree | cbac63335eb78aabfdd49e23beea936963e5034e | |
parent | bfbceea1bd99eb90cdd5c75b68b2e3a158a289f8 (diff) | |
download | psutil-b3f10de5f035cdd7093f688f5add7a857f9b7a85.tar.gz |
fix some failing tests on OSX
-rw-r--r-- | psutil/_psmswindows.py | 2 | ||||
-rw-r--r-- | test/test_psutil.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/psutil/_psmswindows.py b/psutil/_psmswindows.py index 18ef4032..f640d492 100644 --- a/psutil/_psmswindows.py +++ b/psutil/_psmswindows.py @@ -37,7 +37,7 @@ except Exception: warnings.warn("couldn't determine platform's NUM_CPUS", RuntimeWarning) try: BOOT_TIME = _psutil_mswindows.get_system_boot_time() -except Exception, err: +except Exception: BOOT_TIME = None warnings.warn("couldn't determine platform's BOOT_TIME", RuntimeWarning) try: diff --git a/test/test_psutil.py b/test/test_psutil.py index 5b0b9b8d..3650e333 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -46,7 +46,7 @@ BSD = sys.platform.startswith("freebsd") _subprocesses_started = set() -def get_test_subprocess(cmd=None, stdout=DEVNULL, stderr=DEVNULL, stdin=None, +def get_test_subprocess(cmd=None, stdout=DEVNULL, stderr=DEVNULL, stdin=DEVNULL, wait=False): """Return a subprocess.Popen object to use in tests. By default stdout and stderr are redirected to /dev/null and the @@ -1064,8 +1064,9 @@ class TestCase(unittest.TestCase): def test_name(self): sproc = get_test_subprocess(PYTHON, wait=True) + name = psutil.Process(sproc.pid).name.lower() pyexe = os.path.basename(os.path.realpath(sys.executable)).lower() - self.assertEqual(psutil.Process(sproc.pid).name.lower(), pyexe) + assert pyexe.startswith(name), (pyexe, name) if os.name == 'posix': |