Add Py.test testing framework support #6730

Merged
merged 10 commits into from Aug 23, 2016

Conversation

Projects
None yet
6 participants
Member

Kojoley commented Jul 12, 2016

This PR is part of preparation for migration to pytest

mdboom added the needs_review label Jul 12, 2016

Kojoley referenced this pull request Jul 12, 2016

Open

Migration to Py.test testing framework #6731

28 of 39 tasks complete
Member

Kojoley commented Jul 12, 2016

Missed several other places, will update PR soon.

tacaswell added this to the 2.1 (next point release) milestone Jul 12, 2016

story645 added the Testing label Jul 20, 2016

Member

story645 commented Jul 20, 2016

Is this a continuation of #5325?

Owner

tacaswell commented Jul 20, 2016

Also, please be aware of https://github.com/matplotlib/pytest-mpl

Kojoley changed the title from Move out from nose specific things in tests to Add Py.test testing framework support Jul 23, 2016

Member

Kojoley commented Aug 21, 2016

Pytest 3.0 released with this change:

yield-based tests are considered deprecated and will be removed in pytest-4.0.

😕

Kojoley added some commits Jul 25, 2016

@Kojoley Kojoley Added travis and appveyor pytest builds
f20cc01
@Kojoley Kojoley A better way to deal with scope pollution in `test_basic` test
1f0792b
@Kojoley Kojoley Pytest `skipif` does not work on classes with generator methods
The bug will not be fixed in pytest because generator functions are
deprecated since pytest 3.0 release.
a66d599
Member

Kojoley commented Aug 21, 2016

Coverage problem is because of if [[ $NOSE_ARGS="--with-coverage" ]]; then in .travis.yml. The expression should be either [ a=b ] or [[ a==b ]].

Member

Kojoley commented Aug 21, 2016

PR is now ready for review and merge.

Key notes:

  • Collection phase is long due to image_comparison decorator
    (pytest runs setup_class during it)
  • matplotlib.test is not aware of pytest yet
  • pytest-xdist is disabled due to #6899
  • --collect-filter is blacklist by default (#6902 (comment))
  • --no-pep8 is implemented, but --pep8 is not
Owner

tacaswell commented Aug 23, 2016

It looks like pytest is finding 5 more tests than nose so that is probably a victory.

It looks like pep8 is being run by pytest on travis, but not on appveyor, but that is ok for now.

There is a big CI hit time wise for this and we will have to (soon) pick some of the nose builds to drop.

@tacaswell tacaswell merged commit 84f471e into matplotlib:master Aug 23, 2016

2 of 3 checks passed

coverage/coveralls Coverage decreased (-9.2%) to 61.033%
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Aug 23, 2016

Member

Kojoley commented Aug 23, 2016

It looks like pep8 is being run by pytest on travis, but not on appveyor, but that is ok for now.

I made this intentionally because we have separated pep8 only build on travis so there is no need to run them on all appveyor builds. Or I was wrong?

Owner

tacaswell commented Aug 23, 2016

If anything pep8 should be skipped by travis pytest build. According to the handy output, it is only 45s which is not a big deal on top of our total runtime.

Owner

jenshnielsen commented Aug 24, 2016

As far as I remember the main reason for splitting pep8 out in a separate build is not so much runtime but making it simpler to spot failures that are due to pep8 only

Member

QuLogic commented on 903d118 Nov 7, 2016

Should we backport this commit?

Member

Kojoley replied Nov 8, 2016

This only was crucial for pytest, while nose somehow is fine without the fix.

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