From 218091f1ae3fd9ee0435fb126ea8e032ed3de76f Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Mon, 15 Jul 2019 16:29:06 -0400 Subject: Added ability to specify nargs ranges with no upper bound --- tests/test_argparse_completer.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tests/test_argparse_completer.py') diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py index 1262b9e1..4ad4c560 100644 --- a/tests/test_argparse_completer.py +++ b/tests/test_argparse_completer.py @@ -596,10 +596,7 @@ def test_unfinished_flag_error(ac_app, command_and_args, text, is_error, capsys) complete_tester(text, line, begidx, endidx, ac_app) out, err = capsys.readouterr() - if is_error: - assert "Flag requires" in out - else: - assert "Flag requires" not in out + assert is_error == all(x in out for x in ["Error:\n", "expected"]) def test_completion_items_default_header(ac_app): @@ -651,11 +648,7 @@ def test_autocomp_hint(ac_app, command_and_args, text, has_hint, capsys): complete_tester(text, line, begidx, endidx, ac_app) out, err = capsys.readouterr() - - if has_hint: - assert "Hint" in out - else: - assert "Hint" not in out + assert has_hint == ("Hint:\n" in out) def test_autocomp_hint_multiple_lines(ac_app, capsys): -- cgit v1.2.1