diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-09-26 19:19:42 +0800 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-09-26 19:19:42 +0800 |
| commit | 730e0fbba6a2ef4a01a5a67759e15dad5613d3a9 (patch) | |
| tree | f62ea9f41ba24158c3e28ed77c5ee633201225c8 | |
| parent | 7a111cfe490f9c81722b2d896d87b9fb77228141 (diff) | |
| download | psutil-730e0fbba6a2ef4a01a5a67759e15dad5613d3a9.tar.gz | |
try to fix travis failure
| -rwxr-xr-x | psutil/tests/test_process.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index 1f695a06..0686ba25 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -868,7 +868,14 @@ class TestProcess(unittest.TestCase): # CPUs on get): # AssertionError: Lists differ: [0, 1, 2, 3, 4, 5, 6, ... != [0] for n in all_cpus: - p.cpu_affinity([n]) + try: + p.cpu_affinity([n]) + except ValueError as err: + if TRAVIS and LINUX and "not eligible" in str(err): + # https://travis-ci.org/giampaolo/psutil/jobs/279890461 + continue + else: + raise self.assertEqual(p.cpu_affinity(), [n]) if hasattr(os, "sched_getaffinity"): self.assertEqual(p.cpu_affinity(), @@ -1264,7 +1271,15 @@ class TestProcess(unittest.TestCase): # set methods succeed_or_zombie_p_exc(zproc.parent) if hasattr(zproc, 'cpu_affinity'): - succeed_or_zombie_p_exc(zproc.cpu_affinity, [0]) + try: + succeed_or_zombie_p_exc(zproc.cpu_affinity, [0]) + except ValueError as err: + if TRAVIS and LINUX and "not eligible" in str(err): + # https://travis-ci.org/giampaolo/psutil/jobs/279890461 + pass + else: + raise + succeed_or_zombie_p_exc(zproc.nice, 0) if hasattr(zproc, 'ionice'): if LINUX: |
