[svn r38706] privatizing config.conftest to config._conftest as well
--HG-- branch : trunk
This commit is contained in:
parent
e2931176bb
commit
a992ca7427
|
@ -32,7 +32,7 @@ class Config(object):
|
||||||
self.option = CmdOptions()
|
self.option = CmdOptions()
|
||||||
self._parser = optparse.OptionParser(
|
self._parser = optparse.OptionParser(
|
||||||
usage="usage: %prog [options] [query] [filenames of tests]")
|
usage="usage: %prog [options] [query] [filenames of tests]")
|
||||||
self.conftest = Conftest()
|
self._conftest = Conftest()
|
||||||
self._initialized = False
|
self._initialized = False
|
||||||
|
|
||||||
def parse(self, args):
|
def parse(self, args):
|
||||||
|
@ -43,7 +43,7 @@ class Config(object):
|
||||||
"can only parse cmdline args once per Config object")
|
"can only parse cmdline args once per Config object")
|
||||||
self._initialized = True
|
self._initialized = True
|
||||||
adddefaultoptions(self)
|
adddefaultoptions(self)
|
||||||
self.conftest.setinitial(args)
|
self._conftest.setinitial(args)
|
||||||
args = [str(x) for x in args]
|
args = [str(x) for x in args]
|
||||||
cmdlineoption, args = self._parser.parse_args(args)
|
cmdlineoption, args = self._parser.parse_args(args)
|
||||||
self.option.__dict__.update(vars(cmdlineoption))
|
self.option.__dict__.update(vars(cmdlineoption))
|
||||||
|
@ -80,7 +80,7 @@ class Config(object):
|
||||||
pkgpath = path.pypkgpath()
|
pkgpath = path.pypkgpath()
|
||||||
if pkgpath is None:
|
if pkgpath is None:
|
||||||
pkgpath = path.check(file=1) and path.dirpath() or path
|
pkgpath = path.check(file=1) and path.dirpath() or path
|
||||||
col = self.conftest.rget("Directory", pkgpath)(pkgpath)
|
col = self._conftest.rget("Directory", pkgpath)(pkgpath)
|
||||||
col._config = self
|
col._config = self
|
||||||
return col
|
return col
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class Config(object):
|
||||||
return getattr(self.option, name)
|
return getattr(self.option, name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
mod, relroots = self.conftest.rget_with_confmod(name, path)
|
mod, relroots = self._conftest.rget_with_confmod(name, path)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return None
|
return None
|
||||||
modpath = py.path.local(mod.__file__).dirpath()
|
modpath = py.path.local(mod.__file__).dirpath()
|
||||||
|
@ -132,7 +132,7 @@ class Config(object):
|
||||||
try:
|
try:
|
||||||
return getattr(self.option, name)
|
return getattr(self.option, name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return self.conftest.rget(name, path)
|
return self._conftest.rget(name, path)
|
||||||
|
|
||||||
def initsession(self):
|
def initsession(self):
|
||||||
""" return an initialized session object. """
|
""" return an initialized session object. """
|
||||||
|
@ -146,11 +146,11 @@ class Config(object):
|
||||||
and looked up in initial config modules.
|
and looked up in initial config modules.
|
||||||
"""
|
"""
|
||||||
if self.option.session is not None:
|
if self.option.session is not None:
|
||||||
return self.conftest.rget(self.option.session)
|
return self._conftest.rget(self.option.session)
|
||||||
else:
|
else:
|
||||||
name = self._getsessionname()
|
name = self._getsessionname()
|
||||||
try:
|
try:
|
||||||
return self.conftest.rget(name)
|
return self._conftest.rget(name)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
importpath = globals()[name]
|
importpath = globals()[name]
|
||||||
|
@ -229,8 +229,8 @@ class Config(object):
|
||||||
self.__file__ = "<options from remote>"
|
self.__file__ = "<options from remote>"
|
||||||
args, conftestdict, cmdlineopts = repr
|
args, conftestdict, cmdlineopts = repr
|
||||||
self.args = [self.topdir.join(x) for x in args]
|
self.args = [self.topdir.join(x) for x in args]
|
||||||
self.conftest.setinitial(self.args)
|
self._conftest.setinitial(self.args)
|
||||||
self.conftest._path2confmods[None].append(override(conftestdict))
|
self._conftest._path2confmods[None].append(override(conftestdict))
|
||||||
for name, val in cmdlineopts.items():
|
for name, val in cmdlineopts.items():
|
||||||
setattr(self.option, name, val)
|
setattr(self.option, name, val)
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ class TerminalSession(Session):
|
||||||
for x in colitems:
|
for x in colitems:
|
||||||
self.out.line("test target: %s" %(x.fspath,))
|
self.out.line("test target: %s" %(x.fspath,))
|
||||||
|
|
||||||
conftestmodules = self.config.conftest.getconftestmodules(None)
|
conftestmodules = self.config._conftest.getconftestmodules(None)
|
||||||
for i,x in py.builtin.enumerate(conftestmodules):
|
for i,x in py.builtin.enumerate(conftestmodules):
|
||||||
self.out.line("initial conf %d: %s" %(i, x.__file__))
|
self.out.line("initial conf %d: %s" %(i, x.__file__))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue