Skip to content

Use raw instead of png for font manager memory leak test - #25569

Merged
QuLogic merged 2 commits into
matplotlib:mainfrom
ksunden:font_man_memtest
Mar 30, 2023
Merged

QuLogic merged 2 commits into
matplotlib:mainfrom
ksunden:font_man_memtest

Conversation

@ksunden

@ksunden ksunden commented Mar 28, 2023

Copy link
Copy Markdown
Member

PR Summary

Some versions of Pillow (notably v9.2.0 is what I had installed) trigger a
failure on this test that looks the same as if it was a failure on our own part.
v9.4.0 of Pillow does not have the same behavior, hence CI does not catch it.

This changes to svg to avoid the external dependency triggering the failure.
The fontmanager lookup that we are explicitly trying to test here does still
trigger for svg output, but the pillow generated one does not

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

Some versions of Pillow (notably v9.2.0 is what I had installed) trigger a failure on this test that looks the same as if it was a failure on our own part. v9.4.0 of Pillow does not have the same behavior, hence CI does not catch it.

This changes to svg to avoid the external dependency triggering the failure. The fontmanager lookup that we are explicitly trying to test here does still trigger for svg output, but the pillow generated one does not
@QuLogic

QuLogic commented Mar 28, 2023

Copy link
Copy Markdown
Member

Would it be safer to output with format='raw'?

@tacaswell tacaswell added this to the v3.8.0 milestone Mar 29, 2023
@tacaswell

Copy link
Copy Markdown
Member

I agree raw would be better here. Would still run it through Agg (which I am 95% sure is faster) rather than the svg backend (which does oodles of text formatting).

Comment thread lib/matplotlib/tests/test_font_manager.py Outdated
@tacaswell tacaswell changed the title Use svg instead of png for font manager memory leak test Use raw instead of png for font manager memory leak test Mar 30, 2023
@QuLogic
QuLogic merged commit e305953 into matplotlib:main Mar 30, 2023
@ksunden
ksunden deleted the font_man_memtest branch March 30, 2023 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants