Issue #9347: Fix formatting for tuples in argparse type= error messages.

This commit is contained in:
Steven Bethard 2011-04-04 01:47:52 +02:00
parent 824504dd7e
commit e3c11b44e3
3 changed files with 6 additions and 2 deletions

View file

@ -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")