[Pytest-commit] commit/tox: hpk42: Merged in olliewalsh/tox (pull request #167)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Oct 29 12:24:25 EDT 2015


1 new commit in tox:

https://bitbucket.org/hpk42/tox/commits/2d13f9d381b1/
Changeset:   2d13f9d381b1
User:        hpk42
Date:        2015-10-29 16:24:21+00:00
Summary:     Merged in olliewalsh/tox (pull request #167)

Reorder the processing of testenv options.
Affected #:  2 files

diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -927,6 +927,18 @@
         assert argv[7][0] == config.homedir.join(".tox", "distshare")
         assert argv[8][0] == conf.envlogdir
 
+    def test_substitution_notfound_issue246(tmpdir, newconfig):
+        config = newconfig("""
+            [testenv:py27]
+            setenv =
+                FOO={envbindir}
+                BAR={envsitepackagesdir}
+        """)
+        conf = config.envconfigs['py27']
+        env = conf.setenv
+        assert 'FOO' in env
+        assert 'BAR' in env
+
     def test_substitution_positional(self, newconfig):
         inisource = """
             [testenv:py27]

diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tox/config.py
--- a/tox/config.py
+++ b/tox/config.py
@@ -320,6 +320,18 @@
                         help="additional arguments available to command positional substitution")
 
     # add various core venv interpreter attributes
+    def basepython_default(testenv_config, value):
+        if value is None:
+            for f in testenv_config.factors:
+                if f in default_factors:
+                    return default_factors[f]
+            return sys.executable
+        return str(value)
+
+    parser.add_testenv_attribute(
+        name="basepython", type="string", default=None, postprocess=basepython_default,
+        help="executable name or path of interpreter used to create a "
+             "virtual test environment.")
 
     parser.add_testenv_attribute(
         name="envdir", type="path", default="{toxworkdir}/{envname}",
@@ -453,19 +465,6 @@
         name="usedevelop", type="bool", postprocess=develop, default=False,
         help="install package in develop/editable mode")
 
-    def basepython_default(testenv_config, value):
-        if value is None:
-            for f in testenv_config.factors:
-                if f in default_factors:
-                    return default_factors[f]
-            return sys.executable
-        return str(value)
-
-    parser.add_testenv_attribute(
-        name="basepython", type="string", default=None, postprocess=basepython_default,
-        help="executable name or path of interpreter used to create a "
-             "virtual test environment.")
-
     parser.add_testenv_attribute_obj(InstallcmdOption())
     parser.add_testenv_attribute_obj(DepOption())
 
@@ -709,7 +708,7 @@
             if atype == "path":
                 reader.addsubstitutions(**{env_attr.name: res})
 
-            if env_attr.name == "install_command":
+            if env_attr.name == "envdir":
                 reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython,
                                         envsitepackagesdir=vc.envsitepackagesdir)
         return vc

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