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

Use tox to run tests on multiple versions of python #20

Merged
merged 1 commit into from
May 20, 2016

Conversation

xrotwang
Copy link
Contributor

Running tests with tox [1] has some advantages:

  • Running tests with multiple versions of python is simple.
  • Proper package installation is tested as well. So for example
    the presence of README.rst when setup.py is run can only be
    guaranteed when this file is packaged with pygbif. tox will discover
    issues like this.

[1] https://pypi.python.org/pypi/tox

Running tests with tox [1] has some advantages:
- Running tests with multiple versions of python is simple.
- Proper package installation is tested as well. So for example
  the presence of README.rst when setup.py is run can only be
  guaranteed when this file is packaged with pygbif. tox will discover
  issues like this.

[1] https://pypi.python.org/pypi/tox
@coveralls
Copy link

coveralls commented May 20, 2016

Coverage Status

Coverage remained the same at 57.878% when pulling a44b99b on xrotwang:master into 9ee5980 on sckott:master.

@sckott
Copy link
Collaborator

sckott commented May 20, 2016

thanks, having a look

@sckott
Copy link
Collaborator

sckott commented May 20, 2016

@xrotwang a few questions:

  • how does integration with Travis happen? do we change this https://github.com/sckott/pygbif/blob/master/.travis.yml#L14-L15
  • ever run into problems with PYTHONPATH? I often have this problem, where when I want to switch from python 2 to 3 and vice versa, I have to unset PYTHONPATH, then I can use python3, but after that python2 can't be found correctly - Any solutions?

@xrotwang
Copy link
Contributor Author

No, Travis integration stays the same. tox does only help with running the tests locally. Basically, Travis and tox do the same thing: Create a virtualenv per python version, and run the tests there. But tox - unlike Travis - first creates a dist package from the sources and installs this dist package in each virtualenv. This is why I spotted the missing MANIFEST.in.

Since tox uses virtualenv to isolate test environements for each python version, problems with PYTHONPATH should not occur. This is taken care of by the virtualenv after all.

@sckott
Copy link
Collaborator

sckott commented May 20, 2016

Hmm, i've always had a borked local python setup, so i'll just keep testing manually - and try to sort it out some day

@sckott sckott merged commit 4306afe into gbif:master May 20, 2016
@niconoe niconoe mentioned this pull request May 26, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants