[TIP] (RFC) multi-dimensional/variant tox configuration (V1)

Stefan Scherfke stefan at sofa-rockers.org
Tue Jul 10 01:20:04 PDT 2012


Hi Holger,

I really like the idea. However, I found one bug and have one note:

> Generating and selecting variants
> ----------------------------------------------
> 
>> 
> Without much further introduction, here is an example ``tox.ini``::
> 
>   envlist = 
>       py[26,27,32,py]-mypkg[13,14]
> 
>> 
>   [testenv-mypkg13]
>       +deps = mypkg<1.4
> 
>   [testenv-django14]
>       +deps = mypkg<1.5

I think it should be “testenv-mypkg14” instead of “testenv-django14”?


> If you don't want to run django-mypkg with pypy the envlist would look like
> this::
> 
>   envlist = 
>       py[26,27,32]-mypkg[13,14]
>       pypy-mypkg14
> 
> 
> Generator expressions in the envlist setting
> ----------------------------------------------------------
> 
> Generator expressions in the ``envlist`` work like this:
> 
> * ``[...]`` parts contain a comma-separated list of names. Each name
> will generate a new environment reference. 
> * repeat the process until there are no more generator expressions

I think you should make it more clear that:

* you split the envlist entries by “-” --> ['py[26,27,32]', 'mypkg[13,14]']
* you then expand the generator expressions  --> [['py26', 'py27', 'py32'], ['mypkg13', 'mypkg14']]
* and finally compute the cartesian product of that nested list.
* you can create a section for each item in the resulting list (i.e., “py26” or “mypkg13”)
* some of theses entries are predfined in tox (i.e. py26, pypy, …) (you state this later, but it would be more helpful to remind the reader a bit earlier)

Cheers,
Stefan


More information about the testing-in-python mailing list