@@ -2399,7 +2399,7 @@ def test_wrong_argument_subparsers_no_destination_error(self):
23992399 parser .parse_args (('baz' ,))
24002400 self .assertRegex (
24012401 excinfo .exception .stderr ,
2402- r"error: argument {foo,bar}: invalid choice: ' baz' \(choose from ' foo', ' bar' \)\n$"
2402+ r"error: argument {foo,bar}: invalid choice: baz \(choose from foo, bar\)\n$"
24032403 )
24042404
24052405 def test_optional_subparsers (self ):
@@ -6061,7 +6061,7 @@ def test_subparser(self):
60616061 args = parser .parse_args (['x' , '--' , 'run' , '--' , 'a' , '--' , 'b' ])
60626062 self .assertEqual (NS (foo = 'x' , f = None , bar = ['a' , '--' , 'b' ]), args )
60636063 self .assertRaisesRegex (argparse .ArgumentError ,
6064- "invalid choice: '--' " ,
6064+ "invalid choice: -- " ,
60656065 parser .parse_args , ['--' , 'x' , '--' , 'run' , 'a' , 'b' ])
60666066
60676067 def test_subparser_after_multiple_argument_option (self ):
@@ -6075,7 +6075,7 @@ def test_subparser_after_multiple_argument_option(self):
60756075 args = parser .parse_args (['--foo' , 'x' , 'y' , '--' , 'run' , 'a' , 'b' , '-f' , 'c' ])
60766076 self .assertEqual (NS (foo = ['x' , 'y' ], f = 'c' , bar = ['a' , 'b' ]), args )
60776077 self .assertRaisesRegex (argparse .ArgumentError ,
6078- "invalid choice: '--' " ,
6078+ "invalid choice: -- " ,
60796079 parser .parse_args , ['--foo' , 'x' , '--' , '--' , 'run' , 'a' , 'b' ])
60806080
60816081
0 commit comments