Source

tox-patches / omg

Full commit
# HG changeset patch
# Parent b65b83e882f9ca0830d86b7c3b9964d9f08743fe
diff --git a/tox/_config.py b/tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -438,6 +438,19 @@ class IniReader:
         return groupdict.get('substitution_value', None) == 'posargs' \
                and not groupdict.get('sub_type')
 
+
+    def _replace_from_testenv(self, match):
+        env_and_name = match.group('substitution_value')
+        try:
+            env, name = match.rsplit(':', 1)
+        except ValueError:
+            env = 'testenv'
+            name = env_and_name
+
+
+    def replace_from_section(self, match):
+        pass
+
     def _replace_match(self, match):
         g = match.groupdict()
 
@@ -449,6 +462,8 @@ class IniReader:
         handlers = {
             'posargs' : self._replace_posargs,
             'env' : self._replace_env,
+            'testenv': self._replace_from_testenv,
+            'copy': self.replace_from_section,
             None : self._replace_substitution,
             }
         try: