diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-17 20:28:09 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-17 20:28:09 +0200 |
commit | 3de7b673a08d3931beb03af28d471b984f411d23 (patch) | |
tree | 2220d3320686a0d817983b6c7f53ecf29ae1390f /psutil/_psutil_bsd.c | |
parent | c630eff0991116c036723a80531e85d8d599e6c8 (diff) | |
download | psutil-testing-envvar.tar.gz |
Introduce PSUTIL_TESTING env varpsutil-testing-envvar
...so that we can make stricter assertions in C and py code during tests
only.
* define a C function in _common.c which returns whether the var is set
* set PSUTIL_TESTING from the Makefile
Diffstat (limited to 'psutil/_psutil_bsd.c')
-rw-r--r-- | psutil/_psutil_bsd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index 217a95de..3527b666 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -908,7 +908,6 @@ error: */ static PyMethodDef PsutilMethods[] = { - // --- per-process functions {"proc_oneshot_info", psutil_proc_oneshot_info, METH_VARARGS, @@ -983,6 +982,11 @@ PsutilMethods[] = { {"sensors_battery", psutil_sensors_battery, METH_VARARGS, "Return battery information."}, #endif + + // --- others + {"py_psutil_testing", py_psutil_testing, METH_VARARGS, + "Return True if PSUTIL_TESTING env var is set"}, + {NULL, NULL, 0, NULL} }; |