[svn r38506] config.getvalue_pathlist should also honour option values
(to be uniform with getvalue semantics) --HG-- branch : trunk
This commit is contained in:
parent
7973f472d7
commit
ff9df3c079
|
@ -91,11 +91,14 @@ class Config(object):
|
||||||
where they were found).
|
where they were found).
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
mod, relroots = self.conftest.rget_with_confmod(name, path)
|
return getattr(self.option, name)
|
||||||
except KeyError:
|
except AttributeError:
|
||||||
return None
|
try:
|
||||||
modpath = py.path.local(mod.__file__).dirpath()
|
mod, relroots = self.conftest.rget_with_confmod(name, path)
|
||||||
return [modpath.join(x, abs=True) for x in relroots]
|
except KeyError:
|
||||||
|
return None
|
||||||
|
modpath = py.path.local(mod.__file__).dirpath()
|
||||||
|
return [modpath.join(x, abs=True) for x in relroots]
|
||||||
|
|
||||||
def addoptions(self, groupname, *specs):
|
def addoptions(self, groupname, *specs):
|
||||||
""" add a named group of options to the current testing session.
|
""" add a named group of options to the current testing session.
|
||||||
|
|
|
@ -289,6 +289,10 @@ class TestSessionAndOptions:
|
||||||
assert pl[0] == tmpdir
|
assert pl[0] == tmpdir
|
||||||
assert pl[1] == somepath
|
assert pl[1] == somepath
|
||||||
|
|
||||||
|
config.option.mypathlist = [py.path.local()]
|
||||||
|
pl = config.getvalue_pathlist('mypathlist')
|
||||||
|
assert pl == [py.path.local()]
|
||||||
|
|
||||||
def test_config_iocapturing(self):
|
def test_config_iocapturing(self):
|
||||||
self.tmpdir
|
self.tmpdir
|
||||||
config = py.test.config._reparse([self.tmpdir])
|
config = py.test.config._reparse([self.tmpdir])
|
||||||
|
|
Loading…
Reference in New Issue