summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-01-28 15:42:32 +0100
committerholger krekel <holger@merlinux.eu>2013-01-28 15:42:32 +0100
commit16e444752165f09e651d92e4bcea25db92bfb87b (patch)
tree392c0261efe1adaecac58a73f816625465eea3b2
parentd2625c0b3bfb17770bbf8bbd2512040a3900bd31 (diff)
downloadtox-16e444752165f09e651d92e4bcea25db92bfb87b.tar.gz
- move status to become venv attribute
- remove py3k breaking print
-rw-r--r--tests/test_z_cmdline.py4
-rw-r--r--tox/_cmdline.py21
-rw-r--r--tox/_config.py1
3 files changed, 12 insertions, 14 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index 89d6e38..74e7fe8 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -128,9 +128,9 @@ class TestSession:
assert len(envs) == 2
env1, env2 = envs
session.setenvstatus(env1, "FAIL XYZ")
- assert session.venvstatus[env1.path]
+ assert env1.status
session.setenvstatus(env2, 0)
- assert not session.venvstatus[env2.path]
+ assert not env2.status
session._summary()
out, err = capfd.readouterr()
exp = "%s: FAIL XYZ" % env1.envconfig.envname
diff --git a/tox/_cmdline.py b/tox/_cmdline.py
index a63765e..2692330 100644
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -105,7 +105,8 @@ class Action(object):
if ret:
invoked = " ".join(map(str, popen.args))
if outpath:
- self.report.error("invocation failed, logfile: %s" % outpath)
+ self.report.error("invocation failed, logfile: %s" %
+ outpath)
self.report.error(outpath.read())
raise tox.exception.InvocationError(
"%s (see %s)" %(invoked, outpath))
@@ -214,7 +215,6 @@ class Reporter(object):
class Session:
- passthroughpossible = True
def __init__(self, config, popen=subprocess.Popen, Report=Reporter):
self.config = config
@@ -224,7 +224,6 @@ class Session:
config.logdir.ensure(dir=1)
#self.report.using("logdir %s" %(self.config.logdir,))
self.report.using("tox.ini: %s" %(self.config.toxinipath,))
- self.venvstatus = {}
self._spec2pkg = {}
self._name2venv = {}
try:
@@ -256,12 +255,11 @@ class Session:
return action
def runcommand(self):
- #tw.sep("-", "tox info from %s" % self.options.configfile)
- self.report.using("tox-%s from %s" %(tox.__version__, tox.__file__))
+ self.report.using("tox-%s from %s" %(tox.__version__,
+ tox.__file__))
if self.config.minversion:
minversion = NormalizedVersion(self.config.minversion)
toxversion = NormalizedVersion(tox.__version__)
- #self.report.using("requires at least %s" %(minversion,))
if toxversion < minversion:
self.report.error(
"tox version is %s, required is at least %s" %(
@@ -283,7 +281,7 @@ class Session:
src.copy(target)
def setenvstatus(self, venv, msg):
- self.venvstatus[venv.path] = msg
+ venv.status = msg
def _makesdist(self):
setup = self.config.setupdir.join("setup.py")
@@ -307,7 +305,7 @@ class Session:
def setupenv(self, venv):
action = self.newaction(venv, "getenv", venv.envconfig.envdir)
with action:
- self.venvstatus[venv.path] = 0
+ venv.status = 0
try:
status = venv.update(action=action)
except tox.exception.InvocationError:
@@ -367,7 +365,7 @@ class Session:
def runtestenv(self, venv, sdist_path, redirect=False):
if not self.config.option.notest:
- if self.venvstatus[venv.path]:
+ if venv.status:
return
if venv.test(redirect=redirect):
self.setenvstatus(venv, "commands failed")
@@ -378,7 +376,7 @@ class Session:
self.report.startsummary()
retcode = 0
for venv in self.venvlist:
- status = self.venvstatus[venv.path]
+ status = venv.status
if status and status != "skipped tests":
msg = " %s: %s" %(venv.envconfig.envname, str(status))
self.report.error(msg)
@@ -386,7 +384,8 @@ class Session:
else:
if not status:
status = "commands succeeded"
- self.report.good(" %s: %s" %(venv.envconfig.envname, status))
+ self.report.good(" %s: %s" %(venv.envconfig.envname,
+ status))
if not retcode:
self.report.good(" congratulations :)")
return retcode
diff --git a/tox/_config.py b/tox/_config.py
index 76d283d..171e20b 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -217,7 +217,6 @@ class parseini:
if override:
for name in config.indexserver:
config.indexserver[name] = IndexServerConfig(name, override)
- print name, config.indexserver[name]
reader.addsubstitions(toxworkdir=config.toxworkdir)
config.distdir = reader.getpath(toxsection, "distdir",