From 40328c463bd01f2a3c2a0958699e1d92cdf8cc1c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 15 Aug 2020 12:29:47 -0400 Subject: [PATCH] If TOX_WORK_DIR is indicated in the environment, honor it. Closes #20. --- src/tox/config/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tox/config/__init__.py b/src/tox/config/__init__.py index 891aa59af..be6c9bd09 100644 --- a/src/tox/config/__init__.py +++ b/src/tox/config/__init__.py @@ -1109,7 +1109,8 @@ def line_of_default_to_zero(section, name=None): reader.addsubstitutions(toxinidir=config.toxinidir, homedir=config.homedir) if config.option.workdir is None: - config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") + default = os.environ.get('TOX_WORK_DIR', "{toxinidir}/.tox") + config.toxworkdir = reader.getpath("toxworkdir", default) else: config.toxworkdir = config.toxinidir.join(config.option.workdir, abs=True)