1. g2p
  2. tox

Commits

g2p  committed 17c25f8

Fix the {envsitepackagesdir} test, and fix lazy-loaded substitutions.

  • Participants
  • Parent commits 154ad29
  • Branches default

Comments (0)

Files changed (2)

File tests/test_z_cmdline.py

View file
  • Ignore whitespace
 def test_envsitepackagesdir(cmd, initproj):
     initproj("pkg512-0.0.5", filedefs={
         'tox.ini': """
+        [testenv]
         commands=
             grep '__version__.*=.*0\.0\.5' {envsitepackagesdir}/pkg512/__init__.py
     """})

File tox/_config.py

View file
  • Ignore whitespace
         if sub_key not in self._subs:
             raise tox.exception.ConfigError(
                 "substitution key %r not found" % sub_key)
-        return '"%s"' % str(self._subs[sub_key]).replace('"', r'\"')
+        val = self._subs[sub_key]
+        if py.builtin.callable(val):
+            self._subs[sub_key] = val = val()
+        return '"%s"' % str(val).replace('"', r'\"')
 
     def _is_bare_posargs(self, groupdict):
         return groupdict.get('substitution_value', None) == 'posargs' \