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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Sep 25 16:01:01 CEST 2014


3 new commits in tox:

https://bitbucket.org/hpk42/tox/commits/81a452f9aee1/
Changeset:   81a452f9aee1
User:        hpk42
Date:        2014-09-25 13:38:44+00:00
Summary:     py25 not supported anymore
Affected #:  1 file

diff -r 73185db55d671a386d617958076d95a88f602328 -r 81a452f9aee1722b22d7b32b8c39ae1602d4184e setup.py
--- a/setup.py
+++ b/setup.py
@@ -19,10 +19,8 @@
 def main():
     version = sys.version_info[:2]
     install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', ]
-    if version < (2, 7) or (3, 0) <= version <= (3, 1):
+    if version < (2, 7):
         install_requires += ['argparse']
-    if version < (2,6):
-        install_requires += ["simplejson"]
     setup(
         name='tox',
         description='virtualenv-based automation of test activities',


https://bitbucket.org/hpk42/tox/commits/69a69d68fc46/
Changeset:   69a69d68fc46
User:        hpk42
Date:        2014-09-25 13:43:21+00:00
Summary:     fix issue190: allow setenv to be empty
Affected #:  3 files

diff -r 81a452f9aee1722b22d7b32b8c39ae1602d4184e -r 69a69d68fc4679616daed127e8f5fd66085805c6 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+1.8.1.dev
+-----------
+
+- fix issue190: allow setenv to be empty.
+
+
 1.8.0
 -----------
 

diff -r 81a452f9aee1722b22d7b32b8c39ae1602d4184e -r 69a69d68fc4679616daed127e8f5fd66085805c6 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -896,6 +896,20 @@
         assert configs["py27"].recreate
         assert not configs["py33"].recreate
 
+    @pytest.mark.issue190
+    def test_factors_in_setenv(self, newconfig):
+        inisource="""
+            [tox]
+            envlist = py27,py26
+
+            [testenv]
+            setenv =
+                py27: X = 1
+        """
+        configs = newconfig([], inisource).envconfigs
+        assert configs["py27"].setenv["X"] == "1"
+        assert "X" not in configs["py26"].setenv
+
 
 class TestGlobalOptions:
     def test_notest(self, newconfig):

diff -r 81a452f9aee1722b22d7b32b8c39ae1602d4184e -r 69a69d68fc4679616daed127e8f5fd66085805c6 tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -526,6 +526,8 @@
 
         value = {}
         for line in s.split(sep):
+            if not line.strip():
+                continue
             name, rest = line.split('=', 1)
             value[name.strip()] = rest.strip()
 


https://bitbucket.org/hpk42/tox/commits/9aae06bf4a78/
Changeset:   9aae06bf4a78
Branch:      issue191
User:        hpk42
Date:        2014-09-25 14:00:32+00:00
Summary:     fix issue191: factors are now defined by the "envlist" and
you don't need to use them in the testenv section anymore.
Affected #:  3 files

diff -r 69a69d68fc4679616daed127e8f5fd66085805c6 -r 9aae06bf4a784026e853365821f19bd4a4fb7716 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,8 @@
 
 - fix issue190: allow setenv to be empty.
 
+- fix issue191: factors are now defined by the "envlist" and
+  you don't need to use them in the testenv section anymore.
 
 1.8.0
 -----------

diff -r 69a69d68fc4679616daed127e8f5fd66085805c6 -r 9aae06bf4a784026e853365821f19bd4a4fb7716 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -910,6 +910,20 @@
         assert configs["py27"].setenv["X"] == "1"
         assert "X" not in configs["py26"].setenv
 
+    @pytest.mark.issue191
+    def test_conditional_factors_not_neccessary(self, newconfig):
+        inisource="""
+            [tox]
+            envlist = py27-{thread,greenlet}
+
+            [testenv]
+            commands = echo {envname}
+        """
+        configs = newconfig([], inisource).envconfigs
+        assert "py27-thread" in str(configs["py27-thread"].commands)
+        assert "py27-greenlet" in str(configs["py27-greenlet"].commands)
+        assert len(configs) == 2
+
 
 class TestGlobalOptions:
     def test_notest(self, newconfig):

diff -r 69a69d68fc4679616daed127e8f5fd66085805c6 -r 9aae06bf4a784026e853365821f19bd4a4fb7716 tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -285,8 +285,8 @@
         config.envlist, all_envs = self._getenvdata(reader, toxsection)
 
         # configure testenvs
-        known_factors = self._list_section_factors("testenv")
-        known_factors.update(default_factors)
+        known_factors = set(default_factors)
+        map(known_factors.update, [x.split("-") for x in config.envlist])
         known_factors.add("python")
         for name in all_envs:
             section = testenvprefix + name
@@ -301,14 +301,6 @@
 
         config.skipsdist = reader.getbool(toxsection, "skipsdist", all_develop)
 
-    def _list_section_factors(self, section):
-        factors = set()
-        if section in self._cfg:
-            for _, value in self._cfg[section].items():
-                exprs = re.findall(r'^([\w{},-]+)\:\s+', value, re.M)
-                factors.update(*mapcat(_split_factor_expr, exprs))
-        return factors
-
     def _makeenvconfig(self, name, section, subs, config):
         vc = VenvConfig(envname=name)
         vc.config = config

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