Merge pull request #6103 from blueyed/lsof_check
tests: lsof_check: include exc with skip message
This commit is contained in:
commit
8dcee39ce9
|
@ -888,9 +888,9 @@ def lsof_check():
|
||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output(("lsof", "-p", str(pid))).decode()
|
out = subprocess.check_output(("lsof", "-p", str(pid))).decode()
|
||||||
except (OSError, subprocess.CalledProcessError, UnicodeDecodeError):
|
except (OSError, subprocess.CalledProcessError, UnicodeDecodeError) as exc:
|
||||||
# about UnicodeDecodeError, see note on pytester
|
# about UnicodeDecodeError, see note on pytester
|
||||||
pytest.skip("could not run 'lsof'")
|
pytest.skip("could not run 'lsof' ({!r})".format(exc))
|
||||||
yield
|
yield
|
||||||
out2 = subprocess.check_output(("lsof", "-p", str(pid))).decode()
|
out2 = subprocess.check_output(("lsof", "-p", str(pid))).decode()
|
||||||
len1 = len([x for x in out.split("\n") if "REG" in x])
|
len1 = len([x for x in out.split("\n") if "REG" in x])
|
||||||
|
|
Loading…
Reference in New Issue