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+pytest to execute the tests, map to the CI systems #165

Merged
merged 8 commits into from Oct 3, 2018

Conversation

@adferrand
Copy link
Contributor

adferrand commented Oct 2, 2018

Note: this PR should be merged only after #164, as it includes its changes (everything up to ca76f3c included).

Nose seems to be outdated and not maintained anymore. It is advised on their website to use another test framework. Furthermore I had some difficulties to make nose run correctly tests.

Pytest is the de facto standard test framework in Python. Tox is the widely used tool to prepare test environment for pytest. Both of them are unlikely to be dropped.

This PR implements pytest+tox to be used in the CI systems AppVeyor and Travis. Doing so the test environment is configured in a common location for both Windows and Linux (tox.ini). Additionally to the test environment run by default, a notnetwork is settled to execute tests on a machine without network: it takes advantage of the pytest marker mechanism, by adding the decorator @pytest.mark.network on tests that requires a functional network.

Regards,
Adrien Ferrand

@adferrand adferrand changed the title Tox pytest Use tox+pytest to execute the tests, map to the CI systems Oct 2, 2018
nsist/tests/test_pypi.py Outdated Show resolved Hide resolved
Adrien Ferrand added 5 commits Oct 2, 2018
… Lot of refactoring, remove unittest and testpath dependencies. Improve linting.
Adrien Ferrand
Adrien Ferrand
@adferrand

This comment has been minimized.

Copy link
Contributor Author

adferrand commented Oct 2, 2018

Berserk refactor mode triggered:

  • use built-in fixtures instead of teardown/setup
  • remove tests classes
  • use standard assert or pytest.raises
  • add decorator to skip or run only tests for windows
  • correct linting errors
  • reduce test dependencies
@takluyver

This comment has been minimized.

Copy link
Owner

takluyver commented Oct 3, 2018

Thanks!

I'm probably going to reintroduce testpath as a dependency and get rid of the equivalent functions in utils - testpath is another package I wrote, so I have a high degree of trust in it, and I think some of its other functions might be useful for further testing.

@takluyver takluyver merged commit 8aa32b9 into takluyver:master Oct 3, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@takluyver

This comment has been minimized.

Copy link
Owner

takluyver commented Oct 3, 2018

I redid the merge manually to clean up the commit history a bit - I meant to squash it on Github, but I forgot when I clicked the button. New merge commit is 8e1a937.

@adferrand adferrand deleted the adferrand:tox_pytest branch Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.