From 8c21416798af488da173b2b1c98b5435c0865660 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 29 Oct 2019 15:18:29 +0100 Subject: [PATCH] lsof_check: include exc with skip message --- testing/test_capture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/test_capture.py b/testing/test_capture.py index 67aa0c77e..a79b4077b 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -905,9 +905,9 @@ def lsof_check(): pid = os.getpid() try: 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 - pytest.skip("could not run 'lsof'") + pytest.skip("could not run 'lsof' ({!r})".format(exc)) yield out2 = subprocess.check_output(("lsof", "-p", str(pid))).decode() len1 = len([x for x in out.split("\n") if "REG" in x])