Skip to content

Commit

Permalink
tests: integration test for trailing underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
djpohly committed Feb 6, 2024
1 parent b89c6d9 commit 9c709b8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,19 @@ def cmd(a_b):
assert run(parser, "hello").out == "hello\n"


@pytest.mark.xfail
def test_trailing_underscore_keys():
"""One trailing underscore is ignored in function args."""

def cmd(*, a, b_, c__):
return f"a='{a}' b_='{b_}' c__='{c__}'"

parser = DebugArghParser()
parser.set_default_command(cmd)

assert run(parser, "--a x --b y --c- z").out == "a='x' b_='y' c__='z'\n"


@mock.patch("argh.assembling.COMPLETION_ENABLED", True)
def test_custom_argument_completer():
"Issue #33: Enable custom per-argument shell completion"
Expand Down

0 comments on commit 9c709b8

Please sign in to comment.