[Pytest-commit] commit/tox: nakatoio: Add test for issue #307

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jun 20 09:19:32 EDT 2016


1 new commit in tox:

https://bitbucket.org/hpk42/tox/commits/62c553e32ce9/
Changeset:   62c553e32ce9
User:        nakatoio
Date:        2016-05-10 03:16:44+00:00
Summary:     Add test for issue #307

This adds a test to address the second example in issue #307, the
first example is already addressed.

Closes issue #307
Affected #:  1 file

diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r 62c553e32ce9e20de98d035721ce3f5313903ea6 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -288,6 +288,20 @@
         x = reader.getargvlist("commands")
         assert x == [['thing', 'argpos', 'arg2']]
 
+    def test_command_section_and_posargs_substitution(self, newconfig):
+        """Ensure subsitition from other section with posargs succeeds"""
+        config = newconfig("""
+            [section]
+            key = thing arg1
+            [testenv]
+            commands =
+                {[section]key} {posargs} endarg
+            """)
+        reader = SectionReader("testenv", config._cfg)
+        reader.addsubstitutions([r"argpos"])
+        x = reader.getargvlist("commands")
+        assert x == [['thing', 'arg1', 'argpos', 'endarg']]
+
     def test_command_env_substitution(self, newconfig):
         """Ensure referenced {env:key:default} values are substituted correctly."""
         config = newconfig("""

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