bobber6467 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

multiple same args passed, only the last one seen #407

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a nose plugin and implement the def options(self, parser, 
env=os.environ) method.
2. Add a parser option that has action="append", such as:

parser.add_option("--foo", action="append", dest="foo")

3. Run your plugin by passing multiple times the same argument, such as:

python setup.py nosetests --foo 123 --foo 456

What is the expected output? What do you see instead?

Under the .configure(self, options, config) method "options.foo" should return 
[123, 456] but I see [456].

What version of the product are you using? On what operating system?

>>> import nose
>>> nose.__version__
'1.0.0'

Please provide any additional information below.

I do have a setup.cfg containing a [nosetests] section with options unrelated 
to the "foo" option, such as with-coverage=1, ...

Original issue reported on code.google.com by alexandr...@gmail.com on 25 Mar 2011 at 10:06

GoogleCodeExporter commented 8 years ago
Can you provide a small plugin version of your plugin that reproduces this?

Original comment by kumar.mcmillan on 26 Mar 2011 at 4:32

GoogleCodeExporter commented 8 years ago
Sure! You can look at/pull the code from:

https://bitbucket.org/aconrad/nose-testappend/src

And you can read the README for instructions.

Thanks Kumar for looking into it! :)

Original comment by alexandr...@gmail.com on 26 Mar 2011 at 8:11

GoogleCodeExporter commented 8 years ago
Note that I did not have a setup.cfg at all here in my test and it still fails. 
I thought I'd mention "setup.cfg" as it gave me a hint that the problem may be 
due to option merging.

Original comment by alexandr...@gmail.com on 26 Mar 2011 at 8:15