This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Jason.Vas.Dias, bethard, eric.araujo, ezio.melotti, paul.j3, r.david.murray
Date 2013-07-31.01:27:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375234060.82.0.962690056488.issue11955@psf.upfronthosting.co.za>
In-reply-to
Content
The test names are:

FAIL: test_failures_many_groups_listargs (__main__.TestFileTypeW)     
FAIL: test_failures_many_groups_sysargs (__main__.TestFileTypeW)      
FAIL: test_failures_no_groups_listargs (__main__.TestFileTypeW)       
FAIL: test_failures_no_groups_sysargs (__main__.TestFileTypeW)        
FAIL: test_failures_one_group_listargs (__main__.TestFileTypeW)       
FAIL: test_failures_one_group_sysargs (__main__.TestFileTypeW)    

So they differ by [many_groups, no_groups, one_group] and [listargs, sysargs]

There are about 170 tests in test_argparse that get multiplied by 6 in this way.  If this replication was removed it would cut the number of tests and time to nearly a third.

This replication is not useful.  listargs and sysargs differ only in how a list of arguments is passed to parse_args, either directly, or via sys.argv.  It should be sufficient to test these alternatives once, not 170 times.

'one group' creates an argument group, and adds all arguments to that.  'many groups' creates an argument group for each added argument.  But argument groups are not used for 'parse_args'.  They are only used when formatting help.  By default all the arguments of parser are already put into one of two groups, 'optional arguments' or 'positional arguments'.

There are tests for the help formatting, but they don't use this ParserTesterMetaclass.  

I would recommend removing this test replication.  It is both unnecessary and a source of confusion.  The simplest would be to change the end of the ParserTesterMetaclass.  

    class ParserTesterMetaclass
        def __init__()
        ....
            for add_arguments in [no_groups]:
                for parse_args in [listargs]:
                    AddTests(cls, add_arguments, parse_args)

I suspect there is some confusion among users and developers as to what argument groups do.  

As for the TestFileTypeW error, I suspect it has to do with file writing privileges.  I haven't encountered it, but I running tests in my own directory.
History
Date User Action Args
2013-07-31 01:27:40paul.j3setrecipients: + paul.j3, bethard, ezio.melotti, eric.araujo, r.david.murray, Jason.Vas.Dias
2013-07-31 01:27:40paul.j3setmessageid: <1375234060.82.0.962690056488.issue11955@psf.upfronthosting.co.za>
2013-07-31 01:27:40paul.j3linkissue11955 messages
2013-07-31 01:27:40paul.j3create