Hi,
I am able to override multiple config parameters using the nose-testconfig plugin only if I pass the overriding parameters on the command line, 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 the last parameter is modified. e.g.
tc = server2.env2:abc
tc = jack.env1:asl
I checked the plugin code. It looks fine to me. Here is part of the plugin code:
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.