Message166171
The tests look like they're testing the right things, but the tests should instead be written like the rest of the argparse tests. For example, look at TestOptionalsNargs3 and TestPositionalsNargs2. You could write your tests to look something like those, e.g.
class TestOptionalsNargs1_3(ParserTestCase):
argument_signatures = [Sig('-x', nargs=(1, 3))]
failures = ['a', '-x', '-x a b c d']
successes = [
('', NS(x=None)),
('-x a', NS(x=['a'])),
('-x a b', NS(x=['a', 'b'])),
('-x a b c', NS(x=['a', 'b', 'c'])),
]
Also, a complete patch will need to document the new feature in the Python documentation, among other things. See the details described here:
http://docs.python.org/devguide/patch.html#preparation |
|
Date |
User |
Action |
Args |
2012-07-22 21:17:51 | bethard | set | recipients:
+ bethard, Danh, wm, atfrase |
2012-07-22 21:17:51 | bethard | set | messageid: <1342991871.46.0.860963829286.issue11354@psf.upfronthosting.co.za> |
2012-07-22 21:17:50 | bethard | link | issue11354 messages |
2012-07-22 21:17:50 | bethard | create | |
|