summaryrefslogtreecommitdiff
path: root/psutil/tests/test_contracts.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-04-04 23:34:26 +0200
committerGitHub <noreply@github.com>2019-04-04 23:34:26 +0200
commitc367b51a70819c6f7328ef2f435d8536067f1199 (patch)
tree0e287e52337a3081f3ad21d641c33f4ed8e18367 /psutil/tests/test_contracts.py
parentf6d6fe1f959ebc93fe0284311dc1441f0a47aef5 (diff)
downloadpsutil-c367b51a70819c6f7328ef2f435d8536067f1199.tar.gz
[Win] return value is not properly handled for undocumented NT* Windows APIs. (#1477)
Diffstat (limited to 'psutil/tests/test_contracts.py')
-rwxr-xr-xpsutil/tests/test_contracts.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py
index 08e9e9b8..adf7b680 100755
--- a/psutil/tests/test_contracts.py
+++ b/psutil/tests/test_contracts.py
@@ -614,8 +614,11 @@ class TestFetchAllProcesses(unittest.TestCase):
# commented as on Linux we might get
# '/foo/bar (deleted)'
# assert os.path.exists(nt.path), nt.path
- elif fname in ('addr', 'perms'):
- assert value
+ elif fname == 'addr':
+ assert value, repr(value)
+ elif fname == 'perms':
+ if not WINDOWS:
+ assert value, repr(value)
else:
self.assertIsInstance(value, (int, long))
self.assertGreaterEqual(value, 0)