[Pytest-commit] commit/tox: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Nov 11 10:16:30 EST 2015


2 new commits in tox:

https://bitbucket.org/hpk42/tox/commits/bc147d78aa43/
Changeset:   bc147d78aa43
User:        hpk42
Date:        2015-11-11 14:58:33+00:00
Summary:     fix setenv/substitution bug
Affected #:  5 files

diff -r 41090d8cb0538a1d9ed0706c678ffe791f1671d7 -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+2.2.1
+-----
+
+- fix bug where {envdir} substitution could not be used in setenv
+  if that env value is then used in {basepython}. Thanks Florian Bruhin.
+
 2.2.0
 -----
 

diff -r 41090d8cb0538a1d9ed0706c678ffe791f1671d7 -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c setup.py
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@
         description='virtualenv-based automation of test activities',
         long_description=open("README.rst").read(),
         url='http://tox.testrun.org/',
-        version='2.2.0',
+        version='2.2.1',
         license='http://opensource.org/licenses/MIT',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
         author='holger krekel',

diff -r 41090d8cb0538a1d9ed0706c678ffe791f1671d7 -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -738,6 +738,32 @@
         assert envconfig.setenv['PYTHONPATH'] == 'something'
         assert envconfig.setenv['ANOTHER_VAL'] == 'else'
 
+    def test_setenv_with_envdir_and_basepython(self, tmpdir, newconfig):
+        config = newconfig("""
+            [testenv]
+            setenv =
+                VAL = {envdir}
+            basepython = {env:VAL}
+        """)
+        assert len(config.envconfigs) == 1
+        envconfig = config.envconfigs['python']
+        assert 'VAL' in envconfig.setenv
+        assert envconfig.setenv['VAL'] == envconfig.envdir
+        assert envconfig.basepython == envconfig.envdir
+
+    def test_setenv_ordering_1(self, tmpdir, newconfig):
+        config = newconfig("""
+            [testenv]
+            setenv=
+                VAL={envdir}
+            commands=echo {env:VAL}
+        """)
+        assert len(config.envconfigs) == 1
+        envconfig = config.envconfigs['python']
+        assert 'VAL' in envconfig.setenv
+        assert envconfig.setenv['VAL'] == envconfig.envdir
+        assert str(envconfig.envdir) in envconfig.commands[0]
+
     @pytest.mark.parametrize("plat", ["win32", "linux2"])
     def test_passenv_as_multiline_list(self, tmpdir, newconfig, monkeypatch, plat):
         monkeypatch.setattr(sys, "platform", plat)

diff -r 41090d8cb0538a1d9ed0706c678ffe791f1671d7 -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c tox/__init__.py
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
 #
-__version__ = '2.2.0'
+__version__ = '2.2.1'
 
 from .hookspecs import hookspec, hookimpl  # noqa
 

diff -r 41090d8cb0538a1d9ed0706c678ffe791f1671d7 -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c tox/config.py
--- a/tox/config.py
+++ b/tox/config.py
@@ -324,6 +324,10 @@
                         help="additional arguments available to command positional substitution")
 
     # add various core venv interpreter attributes
+    parser.add_testenv_attribute(
+        name="envdir", type="path", default="{toxworkdir}/{envname}",
+        help="venv directory")
+
     def basepython_default(testenv_config, value):
         if value is None:
             for f in testenv_config.factors:
@@ -338,10 +342,6 @@
              "virtual test environment.")
 
     parser.add_testenv_attribute(
-        name="envdir", type="path", default="{toxworkdir}/{envname}",
-        help="venv directory")
-
-    parser.add_testenv_attribute(
         name="envtmpdir", type="path", default="{envdir}/tmp",
         help="venv temporary directory")
 
@@ -716,7 +716,7 @@
             if atype == "path":
                 reader.addsubstitutions(**{env_attr.name: res})
 
-            if env_attr.name == "envdir":
+            if env_attr.name == "basepython":
                 reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython,
                                         envsitepackagesdir=vc.envsitepackagesdir)
         return vc


https://bitbucket.org/hpk42/tox/commits/f6cca79ba7f6/
Changeset:   f6cca79ba7f6
User:        hpk42
Date:        2015-11-11 15:14:10+00:00
Summary:     Added tag 2.2.1 for changeset bc147d78aa43
Affected #:  1 file

diff -r bc147d78aa43853a0a7c825da1bb2b68ca034a2c -r f6cca79ba7f6522893ab720e1a5d09ab38fd3543 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -31,3 +31,4 @@
 a674d923b2d8987db4425262c0df9ca259546020 2.2.0
 a674d923b2d8987db4425262c0df9ca259546020 2.2.0
 49d4884aba78ec17864c5b1a444fb5305fd0d93e 2.2.0
+bc147d78aa43853a0a7c825da1bb2b68ca034a2c 2.2.1

Repository URL: https://bitbucket.org/hpk42/tox/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the pytest-commit mailing list