diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-11 13:22:09 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-11 13:22:09 +0100 |
| commit | ffde3264f09c5412ce3987617130f2c9d5d7a22b (patch) | |
| tree | f4a1a9787d6b2d1a6991928bcfce20c38b8ef31c /psutil/tests | |
| parent | 02e25d765040d3f36ecc66249700a8777b175c7a (diff) | |
| download | psutil-ffde3264f09c5412ce3987617130f2c9d5d7a22b.tar.gz | |
try to set PSUTIL_TESTING env var from python before failing
Diffstat (limited to 'psutil/tests')
| -rw-r--r-- | psutil/tests/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 14f1b53f..b94cfe6c 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -753,8 +753,10 @@ unittest.TestCase = TestCase def _setup_tests(): - os.environ['PSUTIL_TESTING'] = '1' - assert psutil._psplatform.cext.py_psutil_testing() + if 'PSUTIL_TESTING' not in os.environ: + os.environ['PSUTIL_TESTING'] = '1' # not guaranteed to work + if not psutil._psplatform.cext.py_psutil_testing(): + raise AssertionError('PSUTIL_TESTING env var is not set') def get_suite(): |
