Commits

Ronny Pfannschmidt  committed 77127b8

whops, qref

  • Participants
  • Parent commits 2b59eed

Comments (0)

Files changed (1)

File referential-substitution

 # HG changeset patch
-# Parent 7507f56be6d891a9e17e72969274a4d990b6206c
+# Parent c28e706bfcf8dcd15a1ef9da906dbc1e9a868596
 
 diff --git a/tests/test_config.py b/tests/test_config.py
 --- a/tests/test_config.py
 +++ b/tests/test_config.py
-@@ -480,6 +480,41 @@ class TestConfigTestEnv:
+@@ -480,6 +480,42 @@ class TestConfigTestEnv:
          argv = conf.commands
          assert argv[0] == ["cmd1", "hello"]
  
 +                {testing:mock:deps}
 +                fun
 +        """
-+        conf = newconfig([], inisource).envconfigs['default']
-+        packages = [dep.name for dep in conf.deps]
-+        assert packages == ['pytest', 'pytest-cov', 'fun']
++        conf = newconfig([], inisource)
++        env = conf.envconfigs['python']
++        packages = [dep.name for dep in env.deps]
++        assert packages == ['pytest', 'pytest-cov', 'mock', 'fun']
 +
 +
  class TestGlobalOptions:
      def test_notest(self, newconfig):
          config = newconfig([], "")
+diff --git a/tox/_config.py b/tox/_config.py
+--- a/tox/_config.py
++++ b/tox/_config.py
+@@ -400,6 +400,11 @@ class IniReader:
+                     (key, envkey))
+             return os.environ[envkey]
+         if key not in self._subs:
++            if ':' in key:
++                section, item = key.rsplit(':', 1)
++                if section in self._cfg and item in self._cfg[section]:
++                    return str(self._cfg[section][item])
++
+             raise tox.exception.ConfigError(
+                 "substitution key %r not found" % key)
+         return str(self._subs[key])