summaryrefslogtreecommitdiff
path: root/psutil/tests/test_system.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2018-01-01 22:04:16 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2018-01-01 22:04:16 +0100
commit9806c4801cba4c239425226d9db8c5a7f8beb902 (patch)
tree3e7feba9e15c9f08ecfdf4d9714d8dd37311d576 /psutil/tests/test_system.py
parentc604a55694cc70d54f7abea628d41d99842944cc (diff)
parenta86c6f65c123442802c44d27e45b5e014a62fe3b (diff)
downloadpsutil-1102-proc-bitness.tar.gz
merge from master1102-proc-bitness
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")