[Pytest-commit] Issue #188: multi-dimensional syntax doesn't work for recreate (others?) (hpk42/tox)

Mike Bayer issues-reply at bitbucket.org
Sun Sep 14 17:35:52 CEST 2014


New issue 188: multi-dimensional syntax doesn't work for recreate (others?)
https://bitbucket.org/hpk42/tox/issue/188/multi-dimensional-syntax-doesnt-work-for

Mike Bayer:

Doing well with 1.8's multidimensional feature.  However it does not seem to work for the "recreate" flag- this is a scalar, not a list, key, but as the docs say the feature should work for "basepython" it would seem this should work:


```
#!

[tox]
minversion=1.8.dev1
envlist = py{27,33}-sqla{079,084,09,10}, coverage

[testenv]
deps=pytest
     mock
     sqla079: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_7_9
     sqla084: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_8_4
     sqla09: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_9
     sqla10: git+http://git.sqlalchemy.org/sqlalchemy.git@master

# this is the part that fails, tried py{27,33}-sqla{10}, etc. and many
# other combinations, tried fixing in _config.py source... no dice
recreate=
	sqla10: True

sitepackages=True
usedevelop=True

commands=
  py{27,33}-sqla{084,09,10}: python -m pytest -n 4 {posargs}
  py{27,33}-sqla{079}: python -m pytest {posargs}

```

with the recreate directive using a multidimensional value I get:


```
#!

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/tox", line 9, in <module>
    load_entry_point('tox==1.8.0.dev1', 'console_scripts', 'tox')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_cmdline.py", line 25, in main
    config = parseconfig(args, 'tox')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 42, in parseconfig
    parseini(config, inipath)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 293, in __init__
    self._makeenvconfig(name, section, reader._subs, config)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 337, in _makeenvconfig
    vc.recreate = reader.getbool(section, "recreate", False)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 609, in getbool
    "boolean value %r needs to be 'True' or 'False'")
tox.ConfigError: ConfigError: boolean value %r needs to be 'True' or 'False'

```

not sure if there's some syntactical trick to make it work but I tried pretty hard.  everything works great if I just go oldschool with that one directive:


```
#!

[tox]
minversion=1.8.dev1
envlist = py{27,33}-sqla{079,084,09,10}, coverage

[testenv]
deps=pytest
     mock
     sqla079: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_7_9
     sqla084: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_8_4
     sqla09: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_9
     sqla10: git+http://git.sqlalchemy.org/sqlalchemy.git@master


sitepackages=True
usedevelop=True

commands=
  py{27,33}-sqla{084,09,10}: python -m pytest -n 4 {posargs}
  py{27,33}-sqla{079}: python -m pytest {posargs}


[testenv:py27-sqla10]
recreate=True

[testenv:py27-sqla09]
recreate=True

[testenv:py33-sqla10]
recreate=True

[testenv:py33-sqla09]
recreate=True

```







More information about the pytest-commit mailing list