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

TST: Fix image comparison directory for test_striped_lines#28737

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
rcomer merged 1 commit intomatplotlib:mainfromQuLogic:fix-test-imagedir
Aug 21, 2024

Conversation

QuLogic
Copy link
Member

PR summary

The image comparison directory is determined byinspect.getfile(func), but when a test is wrapped inrc_context, the file returned iscontextlib since that decorator iscontextlib.contextmanager. Since this test usescheck_figures_equal, that doesn't break it, but it does break thetriage_tests.py tool as it cannot find a corresponding baseline image directory.

Moving therc_context decorator abovecheck_figures_equal fixes the determined directory. While in this case, the context doesn't set anything that would affect figures, it also makes sense to set the context before figures are created.

PR checklist

@QuLogicQuLogic added this to thev3.9.3 milestoneAug 20, 2024
Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

Ok, but I would slightly prefer inlininglinewidth as kwarg, analogous toalpha to have all rc state set the same way.

The image comparison directory is determined by `inspect.getfile(func)`,but when a test is wrapped in `rc_context`, the file returned is`contextlib` since that decorator is `contextlib.contextmanager`. Sincethis test uses `check_figures_equal`, that doesn't break it, but it doesbreak the `triage_tests.py` tool as it cannot find a correspondingbaseline image directory.In this case, the context doesn't set anything that would affectfigures, so inline the effect of the context as keyword arguments.
@QuLogic
Copy link
MemberAuthor

Sure, we can do that. I initially thought this might affect theAxes also, but those are differentrcParams.

Copy link
Member

@rcomerrcomer left a comment

Choose a reason for hiding this comment

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

Sorry I broke it!

@rcomerrcomer merged commit5a9182d intomatplotlib:mainAug 21, 2024
38 of 43 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestAug 21, 2024
@QuLogicQuLogic deleted the fix-test-imagedir branchAugust 21, 2024 07:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@rcomerrcomerrcomer approved these changes

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

Successfully merging this pull request may close these issues.

3 participants
@QuLogic@timhoffm@rcomer

[8]ページ先頭

©2009-2025 Movatter.jp