summaryrefslogtreecommitdiff
path: root/psutil/tests/test_system.py
diff options
context:
space:
mode:
Diffstat (limited to 'psutil/tests/test_system.py')
-rwxr-xr-xpsutil/tests/test_system.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index e93bb6b5..20b132a9 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -19,6 +19,7 @@ import tempfile
import time
import psutil
+from psutil import AIX
from psutil import BSD
from psutil import FREEBSD
from psutil import LINUX
@@ -669,7 +670,8 @@ class TestSystemAPIs(unittest.TestCase):
@unittest.skipIf(LINUX and not os.path.exists('/proc/diskstats'),
'/proc/diskstats not available on this linux version')
- @unittest.skipIf(APPVEYOR, "unreliable on APPVEYOR") # no visible disks
+ @unittest.skipIf(APPVEYOR and psutil.disk_io_counters() is None,
+ "unreliable on APPVEYOR") # no visible disks
def test_disk_io_counters(self):
def check_ntuple(nt):
self.assertEqual(nt[0], nt.read_count)
@@ -689,6 +691,7 @@ class TestSystemAPIs(unittest.TestCase):
assert getattr(nt, name) >= 0, nt
ret = psutil.disk_io_counters(perdisk=False)
+ assert ret is not None, "no disks on this system?"
check_ntuple(ret)
ret = psutil.disk_io_counters(perdisk=True)
# make sure there are no duplicates
@@ -742,7 +745,8 @@ class TestSystemAPIs(unittest.TestCase):
for name in infos._fields:
value = getattr(infos, name)
self.assertGreaterEqual(value, 0)
- if name in ('ctx_switches', 'interrupts'):
+ # on AIX, ctx_switches is always 0
+ if not AIX and name in ('ctx_switches', 'interrupts'):
self.assertGreater(value, 0)
@unittest.skipIf(not HAS_CPU_FREQ, "not suported")