Not able to pass multiple override parameters using nose-testconfig 0.6 plugin in nosetests

Posted by Jaikit on Stack Overflow See other posts from Stack Overflow or by Jaikit
Published on 2010-05-22T01:37:23Z Indexed on 2010/05/22 1:40 UTC
Read the original article Hit count: 258

Filed under:
|

Hi,

I am able to override multiple config parameters using nose-testconfig plugin only if i pass the overriding parameters on commandline. e.g. nosetests -c nose.cfg -s --tc=jack.env1:asl --tc=server2.env2:abc

But when I define the same thing inside nose.cfg, than only the value for last parameter is modified. e.g. tc = server2.env2:abc
tc = jack.env1:asl

I checked the plugin code. It looks fine to me. I am pasting the part of plugin code below:
parser.add_option(

        "--tc", action="append", 
        dest="overrides",
        default = [],
        help="Option:Value specific overrides.")

configure:

    if options.overrides:
        self.overrides = []
        overrides = tolist(options.overrides)
        for override in overrides:
            keys, val = override.split(":")
            if options.exact:
                config[keys] = val
            else:                    
                ns = ''.join(['["%s"]' % i for i in keys.split(".") ])
                # BUG: Breaks if the config value you're overriding is not
                # defined in the configuration file already. TBD
                exec('config%s = "%s"' % (ns, val))

Let me know if any one has any clue.

© Stack Overflow or respective owner

Related posts about nosetests

Related posts about python