Skip to content

Commit

Permalink
Merge pull request #547 from akinomyoga/support-bashcmop-require_cmd
Browse files Browse the repository at this point in the history
test(conftest): support `@pytest.mark.bashcomp(required_cmd=True)`
  • Loading branch information
akinomyoga committed Jun 30, 2021
2 parents 5e9c9a0 + 01959d2 commit 33df79c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 33df79c

Please sign in to comment.