diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-13 16:42:45 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-13 16:42:45 +0200 |
commit | 47379de2dde66d7aa3d64d920b5ab20998299c79 (patch) | |
tree | 98cbe8cab1b7f6f4a0e5082a3d62d098f1bc76fa | |
parent | 445c23e27eaf5f4ea899323abbd00f9a2bf2593b (diff) | |
download | psutil-47379de2dde66d7aa3d64d920b5ab20998299c79.tar.gz |
fix failing tests on netbsd
-rw-r--r-- | psutil/_psutil_bsd.c | 1 | ||||
-rwxr-xr-x | psutil/tests/test_bsd.py | 1 | ||||
-rwxr-xr-x | psutil/tests/test_posix.py | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index d1a27f34..4b6df9c7 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -932,7 +932,6 @@ PsutilMethods[] = { {"proc_open_files", psutil_proc_open_files, METH_VARARGS, "Return files opened by process as a list of (path, fd) tuples"}, #endif - #if defined(PSUTIL_FREEBSD) || defined(PSUTIL_NETBSD) {"proc_num_threads", psutil_proc_num_threads, METH_VARARGS, "Return number of threads used by process"}, diff --git a/psutil/tests/test_bsd.py b/psutil/tests/test_bsd.py index 50b34c09..3d644c92 100755 --- a/psutil/tests/test_bsd.py +++ b/psutil/tests/test_bsd.py @@ -83,6 +83,7 @@ class BSDSpecificTestCase(unittest.TestCase): def tearDownClass(cls): reap_children() + @unittest.skipIf(NETBSD, "-o lstart doesn't work on NETBSD") def test_process_create_time(self): output = sh("ps -o lstart -p %s" % self.pid) start_ps = output.replace('STARTED', '').strip() diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py index a84c3bb6..f810a09e 100755 --- a/psutil/tests/test_posix.py +++ b/psutil/tests/test_posix.py @@ -36,6 +36,7 @@ from psutil.tests import skip_on_access_denied from psutil.tests import TRAVIS from psutil.tests import unittest from psutil.tests import wait_for_pid +from psutil.tests import which def ps(cmd): @@ -295,6 +296,7 @@ class TestSystemAPIs(unittest.TestCase): # returned by psutil @unittest.skipIf(SUNOS, "unreliable on SUNOS") @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") + @unittest.skipIf(not which('ifconfig'), "no ifconfig cmd") def test_nic_names(self): output = sh("ifconfig -a") for nic in psutil.net_io_counters(pernic=True).keys(): |