Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Switch testing to pytest completely#7974

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 14 commits intomatplotlib:masterfromQuLogic:pytest
Feb 3, 2017
Merged

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedJan 28, 2017
edited
Loading

I'm pre-opening this PR to verify that tests continue to build correctly. However, it still depends on#7935 and#7973.

This PR stops installing nose, and uses pytest everywhere. Note that I did not yet delete any redundant builds. I want to make sure everything works with the different methods first and will then see about pruning stuff.

@QuLogicQuLogic added this to the2.1 (next point release) milestoneJan 28, 2017
@tacaswell
Copy link
Member

attn@story645 I think I recognize this issue...

_________________________ TestUnitData.test_update_map _________________________[gw0] linux2 -- Python 2.7.9 /home/travis/build/matplotlib/matplotlib/venv/bin/pythonself = <matplotlib.tests.test_category.TestUnitData object at 0x7fffdfdb6910>    def test_update_map(self):        data = ['a', 'd']        oseq = ['a', 'd']        olocs = [0, 1]            data_update = ['b', 'd', 'e', np.inf]        useq = ['a', 'd', 'b', 'e', 'inf']        ulocs = [0, 1, 2, 3, -2]            unitdata = cat.UnitData(data)        assert unitdata.seq == oseq        assert unitdata.locs == olocs            unitdata.update(data_update)>       assert unitdata.seq == useqE       assert [u'a', u'd', u'b', u'e', u'i'] == ['a', 'd', 'b', 'e', 'inf']E         At index 4 diff: u'i' != u'inf'E         Use -v to get the full difflib/matplotlib/tests/test_category.py:44: AssertionError

@QuLogic Might want to turn off the fast-fail while we debug this?

@story645
Copy link
Member

What version of numpy is that test using? that looks like the fun joy where numpy pre like 1.8 truncates inf and nan to the length of the largest string in the array, which in this case is 1.

@QuLogic
Copy link
MemberAuthor

It looks like NumPy 1.7.1.

Though I have a bigger question of why so few tests seem to be run compared to locally.

@NelleV
Copy link
Member

Side note: that PR is going to conflict against#7970

@@ -4,10 +4,9 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can't we just remove this script?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not against it, but also not going to make that decision unilaterally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I strongly prefer this script stay and remain functional.

@@ -240,7 +237,7 @@ def _sub_labels(axis, subs=()):
assert label_test == label_expected


@cleanup(style='default')
@pytest.mark.style('default')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why is the style classic being replaced by default?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Both lines say default here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Indeed, they do… I thought I had seen some classic being converted to default, but I guess we'll see this once the tests run on travis anyways.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There are a few that do; see#7973 for an explanation.

.travis.yml Outdated
@@ -155,20 +151,20 @@ script:
rm -rf ~/.cache/matplotlib
fi
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
# Workaround for pytest-xdist flaky colletion order
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nitpick: There is a typo here: colletion -> collection

@NelleV
Copy link
Member

@QuLogic We are setting the option to step testing after the first failure to speed up the tests.

@QuLogicQuLogic changed the titleSwitch testing to pytest completely[WIP] Switch testing to pytest completelyJan 29, 2017
@QuLogic
Copy link
MemberAuthor

I've marked this[WIP] so that people focus on#7973 before this one; plus I have to figure out AppVeyor.

@QuLogic
Copy link
MemberAuthor

QuLogic commentedFeb 1, 2017
edited
Loading

I believe this should be working now, once CI catches up. It currently includes#8001 and#8002 as well as several bug fixes that were missed due to the CI not running everything:

  • Changestacklevel of warning inFigure.gca because it's triggered in two tests and on Python 2.7 it doesn't get triggered properly in the second test.
  • Skip broken categories tests temporarily (seepoor categorical support w/ numpy<1.8 #7988)
  • Fix broken!= comparison withSubplotSpec
  • Normalize paths when looking for fonts because Windows requires it.
  • Remove one lastxfail that I missed in earlier PRs.

@tacaswell
Copy link
Member

power-cycled as the code being run on travis (from reading the errors) was not matching the code in the PR. I saw something like this on one of my day-job projects yesterday too. I think the web-hook is firing before the+refs/PRNUMBER/merge references are updating or something...

tacaswelland others added3 commitsFebruary 2, 2017 18:39
In python3 `__ne__` automatically delegates to `__eq__`, in python2 itdoes not and falls back to the default `__ne__` test.  The NumPyversion of `assert_equal` actually checks `if a != b: raise`, whereas theversion of `assert_equal` from `unittest` (where `nose` ultimatelypulls from) checks `if not a == b: raise`
This is a problem on Windows where file paths are case-insensitive.
@QuLogicQuLogic changed the title[WIP] Switch testing to pytest completely[MRG] Switch testing to pytest completelyFeb 3, 2017
@QuLogic
Copy link
MemberAuthor

We're good to go here now.

.travis.yml Outdated
@@ -225,7 +220,7 @@ after_success:
else
echo "Will only deploy docs build from matplotlib master branch"
fi
if [[ $NOSE_ARGS =~ "--with-coverage" || $USE_PYTEST == true ]]; then
if [[ $USE_PYTEST == true ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We should do this on all runs now?

Copy link
MemberAuthor

@QuLogicQuLogicFeb 3, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I was leaving that to#8003, but I see now it doesn't change this condition.@dopplershift Should I turn on coverage for everything here or just leave it for you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Go ahead and turn it on--I'll rebase on it.

Copy link
Member

@NelleVNelleV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@NelleVNelleV changed the title[MRG] Switch testing to pytest completely[MRG+2] Switch testing to pytest completelyFeb 3, 2017
@dstansbydstansby merged commita517c60 intomatplotlib:masterFeb 3, 2017
@dstansbydstansby changed the title[MRG+2] Switch testing to pytest completelySwitch testing to pytest completelyFeb 3, 2017
@dstansby
Copy link
Member

The change to pytest will need documenting, but I've opened up a new issue for that at#8015.

@tacaswell
Copy link
Member

1:======= 6470 passed, 10 skipped, 6 xfailed, 8 xpassed in 644.13 seconds ======== 6502
2:======= 6477 passed, 12 skipped, 2 xfailed, 3 xpassed in 609.06 seconds ======== 6497
3:======== 6485 passed, 4 skipped, 2 xfailed, 3 xpassed in 611.43 seconds ======== 6497
4: docs
5:======== 6485 passed, 4 skipped, 2 xfailed, 3 xpassed in 617.37 seconds ======== 6497
6:======= 7259 passed, 12 skipped, 2 xfailed, 3 xpassed in 610.41 seconds ======== 7276
7:====== 5256 passed, 1227 skipped, 10 xfailed, 1 xpassed in 573.52 seconds ====== 6494
8:======= 6477 passed, 12 skipped, 2 xfailed, 3 xpassed in 579.11 seconds ======== 6494

There seems to be some slight descrepencies in the number of tests each run finds.

@dstansby
Copy link
Member

Adding up those numbers I get 6494 for everything but (6) for which I get 7276.

@dstansby
Copy link
Member

And I'm guessing that the extra checks on (6) are PEP8 checks.

@tacaswell
Copy link
Member

Apparently I can not use a calculator 🐑

@dopplershiftdopplershift mentioned this pull requestFeb 3, 2017
@QuLogicQuLogic deleted the pytest branchFebruary 4, 2017 04:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dopplershiftdopplershiftdopplershift left review comments

@NelleVNelleVNelleV approved these changes

@tacaswelltacaswelltacaswell approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

6 participants
@QuLogic@tacaswell@story645@NelleV@dstansby@dopplershift

[8]ページ先頭

©2009-2025 Movatter.jp