From 3171b58a033b15e005ddfff5dc941129bed4b5da Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 18 Dec 2019 20:43:56 +0100 Subject: [PATCH] test_proc_io_counters: availability depends on Linux kernel version and configuration --- psutil/tests/test_contracts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py index 32c75fd7..6a6c1a65 100755 --- a/psutil/tests/test_contracts.py +++ b/psutil/tests/test_contracts.py @@ -173,8 +173,10 @@ class TestAvailProcessAPIs(PsutilTestCase): self.assertEqual(hasattr(psutil.Process, "rlimit"), LINUX or FREEBSD) def test_io_counters(self): + not_on_linux = (LINUX and not os.path.exists('/proc/1/io')) hasit = hasattr(psutil.Process, "io_counters") - self.assertEqual(hasit, False if MACOS or SUNOS else True) + self.assertEqual(hasit, + False if MACOS or SUNOS or not_on_linux else True) def test_num_fds(self): self.assertEqual(hasattr(psutil.Process, "num_fds"), POSIX) -- 2.26.2