New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negated factor conditions. #292

Closed
pytoxbot opened this Issue Sep 17, 2016 · 6 comments

Comments

Projects
4 participants
@pytoxbot

pytoxbot commented Sep 17, 2016

I'd like to do something like:

[testenv]
commands =
    cov: coverage run ... runtests.py
    cov: coveralls
    !cov: python runtests.py

Currently I have to declare factor conditions for cov and nocov instead, which means users must always specific either cov or nocov with tox -e. If they forget, tox just reports success without running any command:

[testenv]
commands =
    cov: coverage run ... runtests.py
    cov: coveralls
    nocov: python runtests.py
@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @hynek

For the record, since Twisted dropped Python 2.6, I was sorely missing a way to say !py26: twisted too. :|

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @schinckel

FWIW, the syntax @pjdelport describes is documented at http://tox.readthedocs.io/en/latest/config-v2.html#transforming-the-examples-django-rest : I actually assumed it was possible to use this already.

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @pjdelport

An implementation of issue #189 might provide another solution to this, by allowing the above to be expressed as a factor-based testenv override:

[testenv:cov]
commands =
    coverage run ... runtests.py
    coveralls
@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @pjdelport

This would be very handy: I just came here to report exactly the same issue, for the same use case.

Would a PR implementing the !factor: syntax be acceptable?

@jurko-gospodnetic

This comment has been minimized.

Contributor

jurko-gospodnetic commented Nov 29, 2017

Added pull request jurko-gospodnetic#1 for discussion. Not added to this repo as it's based on still unmerged test cleanup pull request #687, but I'll recreate it here as soon as that one is merged.

For now you can test it on that repo and leave the comments there.

@jurko-gospodnetic

This comment has been minimized.

Contributor

jurko-gospodnetic commented Dec 1, 2017

Pull request #694 on this repo now up for discussion and the original one closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment