summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 02:23:32 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 02:23:32 +0100
commitd32973d145bd50f22407d4b8d936f1da6be7313c (patch)
treea34675dab3d0bec7349b97f528bc4c1126ae39c5
parent0797f32c20b2b722cfb93752359fc4e67d5bdd88 (diff)
downloadpsutil-d32973d145bd50f22407d4b8d936f1da6be7313c.tar.gz
re-enable test on appveyor; remove unused C code
-rw-r--r--psutil/_psutil_common.c12
-rwxr-xr-xpsutil/tests/test_system.py4
2 files changed, 3 insertions, 13 deletions
diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c
index 970acb32..694aa147 100644
--- a/psutil/_psutil_common.c
+++ b/psutil/_psutil_common.c
@@ -57,18 +57,6 @@ psutil_testing(void) {
/*
- * Same as above but return a Python bool.
- */
-PyObject *
-py_psutil_is_testing(PyObject *self, PyObject *args) {
- PyObject *res;
- res = psutil_testing() ? Py_True : Py_False;
- Py_INCREF(res);
- return res;
-}
-
-
-/*
* Enable testing mode. This has the same effect as setting PSUTIL_TESTING
* env var. The dual method exists because updating os.environ on
* Windows has no effect.
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index 2da4d60d..20b132a9 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -670,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)
@@ -690,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