diff options
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tests/test_config.py | 15 | ||||
-rw-r--r-- | tests/test_venv.py | 1 | ||||
-rw-r--r-- | tox/__init__.py | 2 | ||||
-rw-r--r-- | tox/_config.py | 3 | ||||
-rw-r--r-- | tox/_venv.py | 1 |
7 files changed, 26 insertions, 2 deletions
@@ -3,10 +3,14 @@ - new multi-dimensional configuration support. Many thanks to Alexander Schepanovski for the complete PR with docs. + And to Mike Bayer for filing an issue wrt to setting booleans. - fix issue148: remove "__PYVENV_LAUNCHER__" from os.environ when starting subprocesses. Thanks Steven Myint. +- fix issue152: set VIRTUAL_ENV when running test commands, + thanks Florian Ludwig. + 1.7.2 ----------- @@ -28,7 +28,7 @@ def main(): description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='1.8.0.dev1', + version='1.8.0.dev2', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff --git a/tests/test_config.py b/tests/test_config.py index 7cbb656..efbbc80 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -882,6 +882,21 @@ class TestConfigTestEnv: for name, config in configs.items(): assert config.basepython == 'python%s.%s' % (name[2], name[3]) + @pytest.mark.issue188 + def test_factors_in_boolean(self, newconfig): + inisource=""" + [tox] + envlist = py{27,33} + + [testenv] + recreate = + py27: True + """ + configs = newconfig([], inisource).envconfigs + assert configs["py27"].recreate + assert not configs["py33"].recreate + + class TestGlobalOptions: def test_notest(self, newconfig): config = newconfig([], "") diff --git a/tests/test_venv.py b/tests/test_venv.py index 00e5f8b..fe2bed7 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -513,6 +513,7 @@ def test_setenv_added_to_pcall(tmpdir, mocksession, newconfig): assert env is not None assert 'ENV_VAR' in env assert env['ENV_VAR'] == 'value' + assert env['VIRTUAL_ENV'] == str(venv.path) for e in os.environ: assert e in env diff --git a/tox/__init__.py b/tox/__init__.py index e12f703..775ed11 100644 --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '1.8.0.dev1' +__version__ = '1.8.0.dev2' class exception: class Error(Exception): diff --git a/tox/_config.py b/tox/_config.py index 4882055..d0f8c3e 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -599,9 +599,12 @@ class IniReader: def getbool(self, section, name, default=None): s = self.getdefault(section, name, default) + if not s: + s = default if s is None: raise KeyError("no config value [%s] %s found" % ( section, name)) + if not isinstance(s, bool): if s.lower() == "true": s = True diff --git a/tox/_venv.py b/tox/_venv.py index fea2f0c..0c56cc0 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -324,6 +324,7 @@ class VirtualEnv(object): setenv = self.envconfig.setenv if setenv: env.update(setenv) + env['VIRTUAL_ENV'] = str(self.path) env.update(extraenv) return env |