Skip to content
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
Closed

Negated factor conditions. #292

pytoxbot opened this issue Sep 17, 2016 · 6 comments
Labels
area:configuration feature:new something does not exist yet, but should level:medium rought estimate that this might be neither easy nor hard to implement

Comments

@pytoxbot
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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?

@obestwalter obestwalter added area:configuration feature:new something does not exist yet, but should level:medium rought estimate that this might be neither easy nor hard to implement and removed enhancement labels Sep 4, 2017
@jurko-gospodnetic
Copy link

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
Copy link

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

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:configuration feature:new something does not exist yet, but should level:medium rought estimate that this might be neither easy nor hard to implement
Projects
None yet
Development

No branches or pull requests

4 participants