We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9b40f5 commit 981bacdCopy full SHA for 981bacd
Lib/test/test_argparse.py
@@ -2218,6 +2218,16 @@ def test_wrong_argument_subparsers_no_suggestions(self):
2218
"invalid choice: 'baz' (choose from 'foo', 'bar')",
2219
excinfo.exception.stderr,
2220
)
2221
+
2222
+ def test_wrong_argument_no_suggestion_implicit(self):
2223
+ parser = ErrorRaisingArgumentParser()
2224
+ parser.add_argument('foo', choices=['bar', 'baz'])
2225
+ with self.assertRaises(ArgumentParserError) as excinfo:
2226
+ parser.parse_args(('bazz',))
2227
+ self.assertIn(
2228
+ "invalid choice: 'bazz' (choose from 'bar', 'baz')",
2229
+ excinfo.exception.stderr,
2230
+ )
2231
2232
class TestInvalidAction(TestCase):
2233
"""Test invalid user defined Action"""
0 commit comments