From c779525b35d991ffd0c81e3023e7462c00558a49 Mon Sep 17 00:00:00 2001 From: Stefano Mazzucco Date: Thu, 18 Jun 2015 22:56:38 +0100 Subject: make passenv attribute type line-list --- tox/config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tox/config.py') diff --git a/tox/config.py b/tox/config.py index 5dba0bc..062992e 100644 --- a/tox/config.py +++ b/tox/config.py @@ -381,10 +381,10 @@ def tox_addoption(parser): help="list of X=Y lines with environment variable settings") def passenv(testenv_config, value): - if len(value) == 1 and "\n" in value[0]: - # If we have a list of 1 element that contains new lines, - # passenv has been specified as a multi line list. - value = value[0].split("\n") + # Flatten the list to deal with space-separated values. + value = list( + itertools.chain.from_iterable( + [x.split(' ') for x in value])) passenv = set(["PATH", "PIP_INDEX_URL", "LANG"]) @@ -407,7 +407,7 @@ def tox_addoption(parser): return passenv parser.add_testenv_attribute( - name="passenv", type="space-separated-list", postprocess=passenv, + name="passenv", type="line-list", postprocess=passenv, help="environment variables needed during executing test commands " "(taken from invocation environment). Note that tox always " "passes through some basic environment variables which are " -- cgit v1.2.1