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 mapleoin
Recipients bethard, flox, mapleoin
Date 2012-07-07.14:58:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
So I was looking into this and it seems that there are (at least) two contradicting test cases. When inheriting a parser from two parents, there are two different behaviours for positionals and for options.

In the case of positionals, there is this test:

def test_same_argument_name_parents(self):
        parents = [self.wxyz_parent, self.z_parent]
        parser = ErrorRaisingArgumentParser(parents=parents)
        self.assertEqual(parser.parse_args('1 2'.split()),
                         NS(w=None, y=None, z='2'))

and this is the context from higher up:


So the tests don't expect an error when two parents provide the same argument. Instead, the eating up of the first argument (in this case '1') seems to be condoned?

When I tried to change the conflict_handler during parent action merging to 'resolve' I got another test failing:

def test_conflicting_parents(self):
            parents=[self.w_parent, self.wxyz_parent])



This tests that two parents which provide the exact same option will raise an error.

So I think the first test is wrong and should be modified to expect an error in the case where two arguments with the same name are provided. Or is there some use case where this behaviour makes sense?
Date User Action Args
2012-07-07 14:58:48mapleoinsetrecipients: + mapleoin, bethard, flox
2012-07-07 14:58:48mapleoinsetmessageid: <>
2012-07-07 14:58:47mapleoinlinkissue15271 messages
2012-07-07 14:58:46mapleoincreate