summaryrefslogtreecommitdiff
path: root/tests/osinfo.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-01-05 10:23:56 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-01-05 10:23:56 -0500
commit6d5ebb6b653b9551c78383e23309860f1f650ba3 (patch)
tree24ed0852d6eac7bbbed00c5246f67e789aa5f0f0 /tests/osinfo.py
parentb750313ade83bd262852863e3003193e2412f456 (diff)
downloadpython-coveragepy-git-6d5ebb6b653b9551c78383e23309860f1f650ba3.tar.gz
These defensive OS checks are not covered
Diffstat (limited to 'tests/osinfo.py')
-rw-r--r--tests/osinfo.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/osinfo.py b/tests/osinfo.py
index a7ebd2ef..de404bb6 100644
--- a/tests/osinfo.py
+++ b/tests/osinfo.py
@@ -34,7 +34,7 @@ if env.WINDOWS:
ctypes.byref(mem_struct),
ctypes.sizeof(mem_struct)
)
- if not ret:
+ if not ret: # pragma: part covered
return 0
return mem_struct.PrivateUsage
@@ -50,12 +50,12 @@ elif env.LINUX:
# Get pseudo file /proc/<pid>/status
with open('/proc/%d/status' % os.getpid()) as t:
v = t.read()
- except IOError:
+ except IOError: # pragma: not covered
return 0 # non-Linux?
# Get VmKey line e.g. 'VmRSS: 9999 kB\n ...'
i = v.index(key)
v = v[i:].split(None, 3)
- if len(v) < 3:
+ if len(v) < 3: # pragma: part covered
return 0 # Invalid format?
# Convert Vm value to bytes.
return int(float(v[1]) * _scale[v[2].lower()])