From 0709305953a7a2beff8ce78178bbfebda6bbdfdb Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 21 Jul 2020 21:21:09 +0300 Subject: [PATCH] testing: improve bash check --- testing/test_parseopt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 59b729d94..4d63d99ee 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -292,10 +292,11 @@ def test_argcomplete(testdir, monkeypatch) -> None: bash_version = subprocess.run( ["bash", "--version"], stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stderr=subprocess.DEVNULL, + check=True, universal_newlines=True, ).stdout - except OSError: + except (OSError, subprocess.CalledProcessError): pytest.skip("bash is not available") if "GNU bash" not in bash_version: # See #7518.