Skip to content

Commit d336c38

Browse files
committed
Fixing linting error.
1 parent 77b8794 commit d336c38

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/test_argparse_custom.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ def test_apcustom_completion_callable_count(kwargs, is_valid) -> None:
6767
@pytest.mark.parametrize('kwargs', [({'choices_provider': fake_func}), ({'completer': fake_func})])
6868
def test_apcustom_no_completion_callable_alongside_choices(kwargs) -> None:
6969
parser = Cmd2ArgumentParser()
70-
with pytest.raises(ValueError) as excinfo:
70+
71+
expected_err = "None of the following parameters can be used alongside a choices parameter"
72+
with pytest.raises(ValueError, match=expected_err):
7173
parser.add_argument('name', choices=['my', 'choices', 'list'], **kwargs)
72-
assert 'None of the following parameters can be used alongside a choices parameter' in str(excinfo.value)
7374

7475

7576
@pytest.mark.parametrize('kwargs', [({'choices_provider': fake_func}), ({'completer': fake_func})])
7677
def test_apcustom_no_completion_callable_when_nargs_is_0(kwargs) -> None:
7778
parser = Cmd2ArgumentParser()
78-
with pytest.raises(ValueError) as excinfo:
79+
80+
expected_err = "None of the following parameters can be used on an action that takes no arguments"
81+
with pytest.raises(ValueError, match=expected_err):
7982
parser.add_argument('--name', action='store_true', **kwargs)
80-
assert 'None of the following parameters can be used on an action that takes no arguments' in str(excinfo.value)
8183

8284

8385
def test_apcustom_usage() -> None:

0 commit comments

Comments
 (0)