Source

tox-patches / referential-substitution

Full commit
# HG changeset patch
# Parent 7507f56be6d891a9e17e72969274a4d990b6206c

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:
         argv = conf.commands
         assert argv[0] == ["cmd1", "hello"]
 
+    def test_take_dependencies_from_other_testenv(self, newconfig):
+        inisource="""
+            [testenv]
+            deps=
+                pytest
+                pytest-cov
+            [testenv:py24]
+            deps=
+                {testenv:deps}
+                fun
+        """
+        conf = newconfig([], inisource).envconfigs['py24']
+        packages = [dep.name for dep in conf.deps]
+        assert packages == ['pytest', 'pytest-cov', 'fun']
+
+    def test_take_dependencies_from_other_section(self, newconfig):
+        inisource="""
+            [testing:pytest]
+            deps=
+                pytest
+                pytest-cov
+            [testing:mock]
+            deps=
+                mock
+            [testenv]
+            deps=
+                {testing:pytest:deps}
+                {testing:mock:deps}
+                fun
+        """
+        conf = newconfig([], inisource).envconfigs['default']
+        packages = [dep.name for dep in conf.deps]
+        assert packages == ['pytest', 'pytest-cov', 'fun']
+
+
 class TestGlobalOptions:
     def test_notest(self, newconfig):
         config = newconfig([], "")