From 80415168522b7e28d575e91ae4ec9c093f30912d Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Tue, 28 Mar 2023 16:01:03 -0500 Subject: [PATCH 1/2] Use svg instead of png for font manager memory leak test 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 --- lib/matplotlib/tests/test_font_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py index 16b5551193cc..414ee1777219 100644 --- a/lib/matplotlib/tests/test_font_manager.py +++ b/lib/matplotlib/tests/test_font_manager.py @@ -340,7 +340,7 @@ def inner(): with BytesIO() as out: with warnings.catch_warnings(): warnings.filterwarnings('ignore') - fig.savefig(out, format='png') + fig.savefig(out, format='svg') inner() From 9334f834212c2bf9815e15646058fc12e13c9831 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 30 Mar 2023 14:09:57 -0400 Subject: [PATCH 2/2] MNT: still use Agg for test but avoid pillow --- lib/matplotlib/tests/test_font_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py index 414ee1777219..b4de12d3b571 100644 --- a/lib/matplotlib/tests/test_font_manager.py +++ b/lib/matplotlib/tests/test_font_manager.py @@ -340,7 +340,7 @@ def inner(): with BytesIO() as out: with warnings.catch_warnings(): warnings.filterwarnings('ignore') - fig.savefig(out, format='svg') + fig.savefig(out, format='raw') inner()