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

Use fig, ax = plt.subplots() in tests#18553

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
QuLogic merged 1 commit intomatplotlib:masterfromtimhoffm:test-subplots
Sep 24, 2020

Conversation

timhoffm
Copy link
Member

PR Summary

Use

fig, ax = plt.subplots()

instead of

fig = plt.figure()ax = plt.subplots(1, 1, 1)

The latter was a common pattern in tests. The former is shorter and thus adds less clutter to the tests.

More similar patterns could be replaced, but that's for another time.

Also fixed here along the way:

  • One test that usedplt.errorbar instead ofax.errorbar - we should test using the OOP API unless we want to test pyplot specifically.
  • Some copy-paste errors in comments.

@timhoffmtimhoffm added this to thev3.4.0 milestoneSep 24, 2020
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

I am hesitant to make too many changes to the tests (as we don't have tests on the tests) in general, but not hesitant enough to reject this change.

@QuLogic
Copy link
Member

Travis passed, even though it is 'waiting' twice.

@QuLogicQuLogic merged commit34f99a9 intomatplotlib:masterSep 24, 2020
@timhoffm
Copy link
MemberAuthor

I am hesitant to make too many changes to the tests (as we don't have tests on the tests) in general.

That's fair. OTOH test code should be concise. And it may serve as a reference for users, which is why we should not use outdated or uncommon ideoms there. IMHO a careful cleanup is advisable.

tacaswell reacted with thumbs up emoji

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

@tacaswelltacaswelltacaswell approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

4 participants
@timhoffm@QuLogic@tacaswell@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp