summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-01-11 08:57:45 +0000
committerGiampaolo Rodola <g.rodola@gmail.com>2016-01-11 08:57:45 +0000
commit059d5d4a7c72022acb174d318f84162cbe646dfc (patch)
tree986f9fd1d96709633594ce3c56cabfd4bf0f9f47
parent0c8e5ce2f010935c82bb136758ea8d9a88d29bdc (diff)
downloadpsutil-059d5d4a7c72022acb174d318f84162cbe646dfc.tar.gz
fix some tests on NetBSD
-rw-r--r--test/_bsd.py1
-rw-r--r--test/test_psutil.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/test/_bsd.py b/test/_bsd.py
index 09fa2608..2e2b9ff0 100644
--- a/test/_bsd.py
+++ b/test/_bsd.py
@@ -22,6 +22,7 @@ from test_psutil import BSD
from test_psutil import FREEBSD
from test_psutil import get_test_subprocess
from test_psutil import MEMORY_TOLERANCE
+from test_psutil import NETBSD
from test_psutil import OPENBSD
from test_psutil import reap_children
from test_psutil import retry_before_failing
diff --git a/test/test_psutil.py b/test/test_psutil.py
index c9f84dd9..b9d34ace 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -2137,7 +2137,7 @@ class TestProcess(unittest.TestCase):
self.assertEqual(p.num_fds(), start)
@skip_on_not_implemented(only_if=LINUX)
- @unittest.skipIf(OPENBSD, "not reliable on OpenBSD")
+ @unittest.skipIf(OPENBSD or NETBSD, "not reliable on Open/NetBSD")
def test_num_ctx_switches(self):
p = psutil.Process()
before = sum(p.num_ctx_switches())
@@ -2730,8 +2730,8 @@ class TestFetchAllProcesses(unittest.TestCase):
self.assertIn(ret, priorities)
def num_ctx_switches(self, ret, proc):
- self.assertTrue(ret.voluntary >= 0)
- self.assertTrue(ret.involuntary >= 0)
+ self.assertGreaterEqual(ret.voluntary, 0)
+ self.assertGreaterEqual(ret.involuntary, 0)
def rlimit(self, ret, proc):
self.assertEqual(len(ret), 2)