diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-10 15:02:37 +0000 |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-10 15:02:37 +0000 |
commit | 3bd1fb8adee0b959dfb13a8b87b541411c0d784b (patch) | |
tree | a737169c4d41c62948f62de142246a0be82ca4b6 | |
parent | adfe66dd40b59144b3d3a0adec8de6558b44abd4 (diff) | |
download | psutil-3bd1fb8adee0b959dfb13a8b87b541411c0d784b.tar.gz |
fix some tests on OSX
-rw-r--r-- | test/_osx.py | 4 | ||||
-rw-r--r-- | test/test_psutil.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/test/_osx.py b/test/_osx.py index 4e08a131..01a5db28 100644 --- a/test/_osx.py +++ b/test/_osx.py @@ -20,7 +20,7 @@ from test_psutil import reap_children, get_test_subprocess, sh PAGESIZE = os.sysconf("SC_PAGE_SIZE") -TOLERANCE = 200 * 1024 # 200 KB +TOLERANCE = 500 * 1024 # 500 KB def sysctl(cmdline): @@ -59,7 +59,7 @@ class OSXSpecificTestCase(unittest.TestCase): difference = abs(first - second) if difference <= tolerance: return - msg = '%r != %r within %r delta (%r difference)' \ + msg = '%r != %r (tolerance=%r, difference=%s)' \ % (first, second, tolerance, difference) raise AssertionError(msg) diff --git a/test/test_psutil.py b/test/test_psutil.py index 52468ae5..c20e350d 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -1431,7 +1431,7 @@ class TestCase(unittest.TestCase): def test_get_num_ctx_switches(self): p = psutil.Process(os.getpid()) before = sum(p.get_num_ctx_switches()) - for x in range(50000): + for x in range(500000): after = sum(p.get_num_ctx_switches()) if after > before: return @@ -1744,6 +1744,7 @@ class TestFetchAllProcesses(unittest.TestCase): if POSIX: assert os.path.isfile(ret), ret if hasattr(os, 'access') and hasattr(os, "X_OK"): + # XXX may fail on OSX self.assertTrue(os.access(ret, os.X_OK)) def ppid(self, ret): |