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

Tox Integration with “setup.py test” command #204

Closed
ronindesign opened this issue May 20, 2017 · 4 comments
Closed

Tox Integration with “setup.py test” command #204

ronindesign opened this issue May 20, 2017 · 4 comments

Comments

@ronindesign
Copy link
Contributor

ronindesign commented May 20, 2017

From http://tox.readthedocs.io/en/latest/example/basic.html#integration-with-setup-py-test-command

Integrating tox with setup.py test is as of October 2016 discouraged as it breaks packaging/testing approaches as used by downstream distributions which expect setup.py test to run tests with the invocation interpreter rather than setting up many virtualenvs and installing packages. If you need to define setup.py test you can better see about integrating your eventual test runner with it, here is an example of setup.py test integration with pytest. As the python eco-system rather moves away from using setup.py as a tool entry point it’s maybe best to not go for any setup.py test integration.

Not sure if this is relevant?

@yannmh
Copy link
Member

yannmh commented May 24, 2017

Hey @ronindesign,

It seems to be that it does not apply to the datadogpy project.

We use Tox for TravisCI only, to facilitate testing on multiple versions of Python. I believe this is not even needed anymore, and I crafted a #127 to get rid of it.

On the other hand, setup.py uses the nose test runner. Running python setup.py is equivalent to

nosetests ./tests

@ronindesign
Copy link
Contributor Author

Ok, just seems like it's an issue of documentation, as CONTRIBUTING.md
mentions running tests via python setup.py test, so I wanted to make sure running nose tests directly didn't miss anything.

Thanks for the follow up on this!

@bittner
Copy link

bittner commented Jun 4, 2017

The Tox documentation change quoted by @ronindesign was caused by tox-dev/tox#330 (comment). It's not really a technical flaw or implementation risk. It's rather a manifestation of the overruling powers of a package maintainer over the opinions of other interested users and collaborators.

The preferable way to run tests should be via tox, even at the cost of some overhead, because this makes the CI server execute the test suite the way you do it as a developer on your local developer machine. You can achieve this in the Travis configuration via the TOXENV environment variable. See Organice/django-organice@1031e8e for a related solution.

@ronindesign
Copy link
Contributor Author

@bittner That makes a lot of sense. Maybe it would be helpful to add examples or comments on this to the contrib docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants