summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Schinckel <matt@schinckel.net>2016-03-16 22:07:24 +1030
committerMatthew Schinckel <matt@schinckel.net>2016-03-16 22:07:24 +1030
commit0ecf7c55ef4c0419b4c93d4cc6b255e0cd457bb0 (patch)
tree93ac03b33820c033f6fc72a5e412aff21668221e
parentab4346fba2a7f92f0a742df624c32ea3ff9767fd (diff)
downloadtox-0ecf7c55ef4c0419b4c93d4cc6b255e0cd457bb0.tar.gz
Add support for extensible reporting on status.
-rw-r--r--tox/hookspecs.py5
-rw-r--r--tox/session.py7
2 files changed, 12 insertions, 0 deletions
diff --git a/tox/hookspecs.py b/tox/hookspecs.py
index 36c539c..c147b13 100644
--- a/tox/hookspecs.py
+++ b/tox/hookspecs.py
@@ -41,3 +41,8 @@ def tox_testenv_create(venv, action):
@hookspec
def tox_testenv_install_deps(venv, action):
""" [experimental] perform install dependencies action for this venv. """
+
+
+@hookspec
+def tox_report_status(venvname, status):
+ """ [experimental] called with each venvname, and the status for that venv. """
diff --git a/tox/session.py b/tox/session.py
index 93ef5d8..b94aa6b 100644
--- a/tox/session.py
+++ b/tox/session.py
@@ -15,6 +15,7 @@ from tox._verlib import NormalizedVersion, IrrationalVersionError
from tox.venv import VirtualEnv
from tox.config import parseconfig
from tox.result import ResultLog
+from tox.hookspecs import hookimpl
from subprocess import STDOUT
@@ -336,6 +337,10 @@ class Session:
raise SystemExit(1)
self._actions = []
+ @property
+ def hook(self):
+ return self.config.pluginmanager.hook
+
def _makevenv(self, name):
envconfig = self.config.envconfigs.get(name, None)
if envconfig is None:
@@ -553,7 +558,9 @@ class Session:
if not self.config.option.notest:
if venv.status:
return
+ self.hook.tox_report_status(venvname=venv.envconfig.envname, status='started')
venv.test(redirect=redirect)
+ self.hook.tox_report_status(venvname=venv.envconfig.envname, status=venv.status)
else:
venv.status = "skipped tests"