Skip to content

Commit 2a8dcc9

Browse files
authored
Merge pull request #7526 from bluetech/win-bash-2
testing: improve bash check
2 parents dbc50a7 + 0709305 commit 2a8dcc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

testing/test_parseopt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,11 @@ def test_argcomplete(testdir, monkeypatch) -> None:
292292
bash_version = subprocess.run(
293293
["bash", "--version"],
294294
stdout=subprocess.PIPE,
295-
stderr=subprocess.PIPE,
295+
stderr=subprocess.DEVNULL,
296+
check=True,
296297
universal_newlines=True,
297298
).stdout
298-
except OSError:
299+
except (OSError, subprocess.CalledProcessError):
299300
pytest.skip("bash is not available")
300301
if "GNU bash" not in bash_version:
301302
# See #7518.

0 commit comments

Comments
 (0)