Commits

offbyone  committed 2d5e1e9

Add a test for bare {posargs} substitution

  • Participants
  • Parent commits 7858ee3
  • Branches posargs-fix

Comments (0)

Files changed (1)

File tests/test_config.py

         argv = conf.commands
         assert argv[0] == ["cmd1", "hello"]
 
+    def test_rewrite_simple_posargs(self, tmpdir, newconfig):
+        inisource = """
+            [testenv:py24]
+            args_are_paths = True
+            changedir = tests
+            commands = cmd1 {posargs}
+        """
+        conf = newconfig([], inisource).envconfigs['py24']
+        argv = conf.commands
+        assert argv[0] == ["cmd1"]
+
+        conf = newconfig(["tests/hello"], inisource).envconfigs['py24']
+        argv = conf.commands
+        assert argv[0] == ["cmd1", "tests/hello"]
+
+        tmpdir.ensure("tests", "hello")
+        conf = newconfig(["tests/hello"], inisource).envconfigs['py24']
+        argv = conf.commands
+        assert argv[0] == ["cmd1", "hello"]
+
 class TestGlobalOptions:
     def test_notest(self, newconfig):
         config = newconfig([], "")