mirror of
https://github.com/python/cpython.git
synced 2025-08-10 11:58:39 +00:00
Issue #9347: Fix formatting for tuples in argparse type= error messages.
This commit is contained in:
parent
824504dd7e
commit
e3c11b44e3
3 changed files with 6 additions and 2 deletions
|
@ -4016,10 +4016,12 @@ class TestInvalidArgumentConstructors(TestCase):
|
|||
|
||||
def test_invalid_type(self):
|
||||
self.assertValueError('--foo', type='int')
|
||||
self.assertValueError('--foo', type=(int, float))
|
||||
|
||||
def test_invalid_action(self):
|
||||
self.assertValueError('-x', action='foo')
|
||||
self.assertValueError('foo', action='baz')
|
||||
self.assertValueError('--foo', action=('store', 'append'))
|
||||
parser = argparse.ArgumentParser()
|
||||
try:
|
||||
parser.add_argument("--foo", action="store-true")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue