[Pytest-commit] Issue #145: 'commands' variable cannot be substituted (hpk42/tox)

Ben Darnell issues-reply at bitbucket.org
Wed Jan 15 05:01:52 CET 2014


New issue 145: 'commands' variable cannot be substituted
https://bitbucket.org/hpk42/tox/issue/145/commands-variable-cannot-be-substituted

Ben Darnell:

Using substitution on the 'commands' variable does not appear to work - the substituted string is passed as a single token to the subprocess module.  I would expect the splitting to be done after performing the substitution.

Stripped down example:
```
[tox]
envlist=py26, py27, py32, py33

[testenv]
commands = python -c 'print "py2"'

[testenv:py32]
commands = python -c 'print("py3")'

[testenv:py33]
commands = {[testenv:py32]commands}
```

Output:
```
GLOB sdist-make: /private/tmp/toxtest/setup.py
py26 inst-nodeps: /private/tmp/toxtest/.tox/dist/UNKNOWN-0.0.0.zip
py26 runtests: commands[0] | python -c print "py2"
py2
py27 recreate: /private/tmp/toxtest/.tox/py27
py27 inst: /private/tmp/toxtest/.tox/dist/UNKNOWN-0.0.0.zip
py27 runtests: commands[0] | python -c print "py2"
py2
py32 inst-nodeps: /private/tmp/toxtest/.tox/dist/UNKNOWN-0.0.0.zip
py32 runtests: commands[0] | python -c print("py3")
py3
py33 inst-nodeps: /private/tmp/toxtest/.tox/dist/UNKNOWN-0.0.0.zip
py33 runtests: commands[0] | python -c 'print("py3")'
ERROR: InvocationError: could not find executable 'python -c \'print("py3")\''
___________________________________ summary ____________________________________
  py26: commands succeeded
  py27: commands succeeded
  py32: commands succeeded
ERROR:   py33: commands failed
```




More information about the pytest-commit mailing list