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_linux.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_linux.c')
-rw-r--r-- | psutil/_psutil_linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c index 1a96fea0..a15ebe5c 100644 --- a/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c @@ -574,7 +574,6 @@ error: */ static PyMethodDef PsutilMethods[] = { - // --- per-process functions #if PSUTIL_HAVE_IOPRIO @@ -607,6 +606,9 @@ PsutilMethods[] = { "Get or set process resource limits."}, #endif + // --- others + {"py_psutil_testing", py_psutil_testing, METH_VARARGS, + "Return True if PSUTIL_TESTING env var is set"}, {NULL, NULL, 0, NULL} }; |