summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in documentation and commentsMartin Panter2016-04-051-5/+5
|
* fix instances of consecutive articles (closes #23221)Benjamin Peterson2015-01-131-1/+1
| | | | Patch by Karan Goel.
* #9351: set_defaults on subparser is no longer ignored if set on parent.R David Murray2014-10-181-0/+7
| | | | | | | | Before, if a default was set on the parent parser, any default for that variable set via set_defaults on a subparser would be ignored. Now the subparser set_defaults is honored. Patch by Jyrki Pullianinen.
* Issue #21481: Teach argparse equality tests to return NotImplemented when ↵Raymond Hettinger2014-05-261-0/+6
| | | | comparing to unknown types.
* make temporary read-only files writable, so rmtree can remove them (#21128)Benjamin Peterson2014-04-041-0/+3
|
* Issue #13107: argparse and optparse no longer raises an exception when outputSerhiy Storchaka2014-01-091-0/+54
| | | | | a help on environment with too small COLUMNS. Based on patch by Elazar Gershuni.
* A follow up for issue #15906: change the test for calling the type conversionBarry Warsaw2012-09-121-4/+27
| | | | | | | | on the action's default, reverting it back to previous behavior. Conversion is only done on string defaults. Add a test for this and another test that ensures such type conversions are only called once.
* - Issue #15906: Fix a regression in argparse caused by the preceding change,Barry Warsaw2012-09-121-0/+10
| | | | when action='append', type='str' and default=[].
* #15847: allow args to be a tuple in parse_argsR David Murray2012-09-081-0/+18
| | | | | | | | This fixes a regression introduced by the fix for issue #13922. Although args is not documented as being allowed to be a tuple, previously this worked and so naturally there are programs in the field that depend on it. Patch by Zbyszek Jędrzejewski-Szmek.
* #12776,#11839: call argparse type function only once.R David Murray2012-09-011-0/+48
| | | | | | | | | Before, the type function was called twice in the case where the default was specified and the argument was given as well. This was especially problematic for the FileType type, as a default file would always be opened, even if a file argument was specified on the command line. Patch by Arnaud Fontaine, with additional test by Mike Meyer.
* #13922: argparse no longer incorrectly strips '--' after the first one.R David Murray2012-07-221-12/+25
| | | | Patch by Jeff Knupp.
* #12353: argparse now correctly handles null argument values.R David Murray2012-07-221-0/+1
| | | | Patch by Torsten Landschoff.
* #11906 Make test_argparse work interactively by removing extra spaceTerry Jan Reedy2012-01-091-4/+6
| | | | in comparison string that argparse does not add when program name is blank.
* Close #13401: Skip TestFileTypeW of test_argparse if the current user is rootVictor Stinner2011-11-201-0/+2
| | | | Patch written by Arfrever Frehtes Taifersar Arahesis.
* Issue #9347: Fix formatting for tuples in argparse type= error messages.Steven Bethard2011-04-031-0/+2
|
* Issue #9026: Fix order of argparse sub-commands in help messages. (Merged ↵Steven Bethard2011-03-271-3/+80
| | | | from 3.2.)
* Issue #9348: Raise an early error if argparse nargs and metavar don't match. ↵Steven Bethard2011-03-261-0/+171
| | | | (Merge from 3.2.)
* Merged revisions ↵R. David Murray2011-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 86542,87136,87216,87221,87228,87256,87337-87338,87372,87516,87571,88164 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86542 | r.david.murray | 2010-11-19 22:48:58 -0500 (Fri, 19 Nov 2010) | 2 lines Make test class name unique so that both test classes run. ........ r87136 | r.david.murray | 2010-12-08 17:53:00 -0500 (Wed, 08 Dec 2010) | 6 lines Have script_helper._assert_python strip refcount strings from stderr. This makes the output of the function and those that depend on it independent of whether or not they are being run under a debug build. ........ r87216 | r.david.murray | 2010-12-13 17:50:30 -0500 (Mon, 13 Dec 2010) | 2 lines #10698: fix typo in example. ........ r87221 | r.david.murray | 2010-12-13 19:55:46 -0500 (Mon, 13 Dec 2010) | 4 lines #10699: fix docstring for tzset: it does not take a parameter Thanks to Garrett Cooper for the fix. ........ r87228 | r.david.murray | 2010-12-13 21:25:43 -0500 (Mon, 13 Dec 2010) | 2 lines Turn on regrtest -W (rerun immediately) option for Windows, too. ........ r87256 | r.david.murray | 2010-12-14 21:19:14 -0500 (Tue, 14 Dec 2010) | 2 lines #10705: document what the values of debuglevel are and mean. ........ r87337 | r.david.murray | 2010-12-17 11:11:40 -0500 (Fri, 17 Dec 2010) | 2 lines #10559: provide instructions for accessing sys.argv when first mentioned. ........ r87338 | r.david.murray | 2010-12-17 11:29:07 -0500 (Fri, 17 Dec 2010) | 2 lines #10454: clarify the compileall docs and help messages. [changes to compileall.py were not backported, only the doc changes] ........ r87372 | r.david.murray | 2010-12-18 11:39:06 -0500 (Sat, 18 Dec 2010) | 2 lines #10728: the default for printing help is sys.stdout, not stderr. ........ r87516 | r.david.murray | 2010-12-27 15:09:32 -0500 (Mon, 27 Dec 2010) | 5 lines #7056: runtest and runtest_inner don't use testdir, so drop it from their sigs I've only tested regular runs and -j runs. If I've broken anything else I'm sure I'll hear about it sooner or later. ........ r87571 | r.david.murray | 2010-12-29 14:06:48 -0500 (Wed, 29 Dec 2010) | 2 lines Fix same typo in docs. ........ r88164 | r.david.murray | 2011-01-24 14:34:58 -0500 (Mon, 24 Jan 2011) | 12 lines #10960: fix 'stat' links, link to lstat from stat, general tidy of stat doc. Original patch by Michal Nowikowski, with some additions and wording fixes by me. I changed the wording from 'Performs a stat system call' to 'Performs the equivalent of a stat system call', since on Windows there are no stat/lstat system calls involved. I also extended Michal's breakout of the attributes into a list to the other paragraphs, and rearranged the order of the paragraphs in the 'stat' docs to make it flow better and put it in what I think is a more logical/useful order. ........
* #10680: fix mutually exclusive arguments in argument groups.Steven Bethard2011-01-301-0/+40
|
* Issue #9509: make argarse properly handle IOErrors raised by ↵Steven Bethard2011-01-241-8/+15
| | | | argparse.FileType. Approved by Georg in the tracker.
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-9/+9
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 86111 via svnmerge fromSteven Bethard2010-11-021-0/+22
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86111 | steven.bethard | 2010-11-02 13:47:22 +0100 (Tue, 02 Nov 2010) | 1 line Fix bug 9340 - argparse parse_known_args didn't work with subparsers ........
* Merged revisions 86092 via svnmerge fromSteven Bethard2010-11-011-0/+19
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86092 | steven.bethard | 2010-11-01 17:29:26 +0100 (Mon, 01 Nov 2010) | 1 line Fix for issue 9355 where with multiple mutually exclusive arguments, some brackets were being lost in the usage messages ........
* Merged revisions 86090 via svnmerge fromSteven Bethard2010-11-011-0/+24
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86090 | steven.bethard | 2010-11-01 16:57:36 +0100 (Mon, 01 Nov 2010) | 1 line Fix bug 9352 where characters were being lost in parsing some short options ........
* Merged revisions 86086 via svnmerge fromSteven Bethard2010-11-011-0/+10
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86086 | steven.bethard | 2010-11-01 16:23:12 +0100 (Mon, 01 Nov 2010) | 1 line Get argparse.__all__ back up to date (issue 9353) ........
* Merged revisions 86080 via svnmerge fromSteven Bethard2010-11-011-0/+9
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86080 | steven.bethard | 2010-11-01 14:56:09 +0100 (Mon, 01 Nov 2010) | 1 line Unset COLUMNS for test_argparse (and restore afterwards) (issue 9553) ........
* Merged revisions 85497 via svnmerge fromAntoine Pitrou2010-10-141-1/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85497 | antoine.pitrou | 2010-10-14 23:15:17 +0200 (jeu., 14 oct. 2010) | 3 lines Explicitly close some files (from issue #10093) ........
* Merged revisions 83675 via svnmerge fromR. David Murray2010-08-031-7/+72
| | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83675 | r.david.murray | 2010-08-03 13:56:09 -0400 (Tue, 03 Aug 2010) | 12 lines #9444: use first of prefix_chars for help opt instead of raising error An argparse option parser created with a prefix_chars that did not include a '-' would happily add -h and --help options, and then throw an error when it tried to format the help because the - was an invalid prefix character. This patch makes it use the first character of prefix_chars as the character for the help options if and only if '-' is not one of the valid prefix_chars. Fix by Theodore Turocy, unit tests by Catherine Devlin. ........
* Fix default value for version help. Approved by Benjamin on python-dev: ↵Steven Bethard2010-05-241-0/+19
| | | | http://mail.python.org/pipermail/python-dev/2010-May/100231.html
* Switch regrtest to use StringIO instead of cStringIO for ↵Michael Foord2010-04-081-5/+9
| | | | test_multiprocessing on Windows. Issue 8333.
* Replace catch_warnings with check_warnings when it makes sense. Use ↵Florent Xicluna2010-03-311-16/+6
| | | | assertRaises context manager to simplify some tests.
* Replace license with simple attribution.Steven Bethard2010-03-241-13/+1
|
* eliminate py3k warnings in argparseBenjamin Peterson2010-03-071-0/+10
|
* plug ref leaksBenjamin Peterson2010-03-021-0/+4
|
* remove cross-version compatibility codeBenjamin Peterson2010-03-021-22/+2
|
* remove code to avoid BaseException.message bugBenjamin Peterson2010-03-021-6/+0
|
* convert deprecated fail* methods to assert* variantsBenjamin Peterson2010-03-021-16/+16
|
* use test_main() in __main__ sectionBenjamin Peterson2010-03-021-1/+1
|
* prevent warning filter adjustment from altering other testsBenjamin Peterson2010-03-021-24/+23
|
* enable running of argparse tests and fix two that failed in the new environmentBenjamin Peterson2010-03-021-4/+11
|
* remove another coding cookieBenjamin Peterson2010-03-021-3/+1
|
* set svn:eol-styleBenjamin Peterson2010-03-021-4206/+4206
|
* Initial commit of the argparse library, based on argparse 1.1.Steven Bethard2010-03-021-0/+4206
Docs still need some updating to make getopt and optparse match the wording promised in the PEP. There are also probably a number of :class:ArgumentParser etc. links that could be added to the argparse documentation.