diff options
| author | holger krekel <holger@merlinux.eu> | 2014-09-23 16:04:03 +0200 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2014-09-23 16:04:03 +0200 |
| commit | d5d42e21988896981f2028b1d986f13c3b5cbeb8 (patch) | |
| tree | 38480a073fd1811a07105d76a08f09a0237d0bfd | |
| parent | 809e11e42c0526fc1893e940b68c8011cf368459 (diff) | |
| download | tox-d5d42e21988896981f2028b1d986f13c3b5cbeb8.tar.gz | |
fix issue188 make boolean config vars use the default if the config file
specifies an empty string
| -rw-r--r-- | CHANGELOG | 2 | ||||
| -rw-r--r-- | setup.py | 2 | ||||
| -rw-r--r-- | tests/test_config.py | 15 | ||||
| -rw-r--r-- | tox/__init__.py | 2 | ||||
| -rw-r--r-- | tox/_config.py | 3 |
5 files changed, 22 insertions, 2 deletions
@@ -3,11 +3,13 @@ - 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. + 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/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 26603c9..07f2365 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -596,9 +596,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 |
