From 01959d25540fa660287bfac720ae83b12d8c5511 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 20 Jun 2021 11:02:47 +0900 Subject: [PATCH] test(conftest): support @pytest.mark.bashcomp(required_cmd=True) --- test/t/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/t/conftest.py b/test/t/conftest.py index 6e3d4e15e90..6604ab28d3d 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -305,6 +305,13 @@ def bash(request) -> pexpect.spawn: ) if match: cmd = match.group(1) + if ( + marker + and marker.kwargs + and marker.kwargs.get("require_cmd", False) + ): + if not is_bash_type(bash, cmd): + pytest.skip("Command not found") request.cls.cmd = cmd