[TIP] tox "empty" factors for generated environment?
holger krekel
holger at merlinux.eu
Sun Jan 31 12:17:52 PST 2016
On Sun, Jan 31, 2016 at 12:55 -0500, Barry Warsaw wrote:
> On Jan 31, 2016, at 08:09 AM, holger krekel wrote:
>
> >What about today's possible ...
> >
> > envlist = {py34,py35}{,-coverage}{,-pg}
>
> Yes! That's exactly what I was (poorly) asking for.
>
> >? I guess it'd be nicer to make {py34,py35}-{,coverage}-{,pg} work as well.
>
> Perhaps, but not necessary. I'm not sure the {,-factor} syntax is documented,
> or if it is I've missed it. So maybe it just needs to be documented more
> visibly in the tox documentation?
>
> Then I think you're right that the only new thing we need is a way to describe
> empty factors in the sections. E.g. now I have:
>
> [tox]
> envlist = {py34,py35}{,-coverage}{,-pg}
>
> [testenv]
> commands =
> python -m nose2 -v
> coverage: python -m coverage run {[coverage]rc} -m nose2 -v
> coverage: python -m coverage combine {[coverage]rc}
> coverage: python -m coverage html {[coverage]rc}
> coverage: python -m coverage report -m {[coverage]rc}
>
> but that means that when I run -e py35-coverage, it runs the first command
> unnecessarily. With your proposal I could write:
>
> [testenv]
> commands =
> !: python -m nose2 -v
> coverage: python -m coverage run {[coverage]rc} -m nose2 -v
> coverage: python -m coverage combine {[coverage]rc}
> coverage: python -m coverage html {[coverage]rc}
> coverage: python -m coverage report -m {[coverage]rc}
>
> and I think that would cover my use case nicely.
However, it would be:
!coverage: python -m nose2 -v
as a single "!" sign would not have much meaning.
holger
> Add issue #223 (default envlists and/or env groups) and I'd be a very happy
> camper. :)
>
> Cheers,
> -Barry
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
--
about me: http://holgerkrekel.net/about-me/
contracting: http://merlinux.eu
More information about the testing-in-python
mailing list