Skip to content

Fix incorrect skip check in test_backend_ps. #26955

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

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 28, 2023

There was a typo in elif rcParams.get("ps.userdistiller") == "xpdf" which effectively always returned False (the correct spelling is "ps.usedistiller", so the get() call always returned None), which made the skip check for xpdf never run. Thus, running the test on a machine without pdftops installed would eventually result in an ExecutableNotFoundError when matplotlib actually tries to call the distiller.

To avoid this kind of problems (dict.get hiding typos), directly update the test-specific settings into the main rcParams, and use normal brackets to access rcParams entries, as rcParams keys are a fixed set anyways.

This broke the mplcairo test suite (where I didn't bother configuring CI to have pdftops installed) so labeling as 3.8.1; "somewhat" release critical (though I guess I could just xfail the test on mplcairo's side instead).

PR summary

PR checklist

There was a typo in `elif rcParams.get("ps.userdistiller") == "xpdf"`
which effectively always returned False (the correct spelling is
"ps.usedistiller", so the get() call always returned None), which
made the skip check for xpdf never run.  Thus, running the test on
a machine without pdftops installed would eventually result in an
ExecutableNotFoundError when matplotlib actually tries to call the
distiller.

To avoid this kind of problems (dict.get hiding typos), directly update
the test-specific settings into the main rcParams, and use normal
brackets to access rcParams entries, as rcParams keys are a fixed set
anyways.
@anntzer anntzer added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: testing backend: ps labels Sep 28, 2023
@anntzer anntzer added this to the v3.8.1 milestone Sep 28, 2023
@ksunden
Copy link
Member

ksunden commented Sep 28, 2023

Anyone can merge on CI passing

@QuLogic QuLogic merged commit e237bbd into matplotlib:main Sep 29, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 29, 2023
@anntzer anntzer deleted the pst branch September 29, 2023 05:47
oscargus added a commit that referenced this pull request Oct 2, 2023
…955-on-v3.8.x

Backport PR #26955 on branch v3.8.x (Fix incorrect skip check in test_backend_ps.)
@ksunden ksunden mentioned this pull request Nov 2, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: ps Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants