Source

tox-patches / homedir-not-for-ci

Full commit
# HG changeset patch
# Parent b120421aaa7edfc91cfe0a4bf1a57da2bf0f2edf
dont use homedir in ci context

diff --git a/tox/_config.py b/tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -115,18 +115,20 @@ class parseini:
         config._cfg = self._cfg
         self.config = config
         ctxname = getcontextname()
-        if ctxname == "jenkins":
+        if ctxname.isalnum():
             reader = IniReader(self._cfg, fallbacksections=['tox'])
             toxsection = "tox:%s" % ctxname
             distshare_default = "{toxworkdir}/distshare"
-        elif not ctxname:
+            # if context is text, we are in ci and dont have a home
+            config.homedir = None
+        elif ctxname is None:
             reader = IniReader(self._cfg)
             toxsection = "tox"
             distshare_default = "{homedir}/.tox/distshare"
+            config.homedir = py.path.local._gethomedir()
         else:
-            raise ValueError("invalid context")
+            raise ValueError("invalid context %r"%ctxname)
 
-        config.homedir = py.path.local._gethomedir()
         reader.addsubstitions(toxinidir=config.toxinidir,
                               homedir=config.homedir)
         config.toxworkdir = reader.getpath(toxsection, "toxworkdir",