We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dff87ce + 6b901fe commit 1341ad5Copy full SHA for 1341ad5
lib/matplotlib/tests/test_font_manager.py
@@ -180,7 +180,16 @@ def test_addfont_as_path():
180
"""Smoke test that addfont() accepts pathlib.Path."""
181
font_test_file = 'mpltest.ttf'
182
path = Path(__file__).parent / font_test_file
183
- fontManager.addfont(path)
+ try:
184
+ fontManager.addfont(path)
185
+ added, = [font for font in fontManager.ttflist
186
+ if font.fname.endswith(font_test_file)]
187
+ fontManager.ttflist.remove(added)
188
+ finally:
189
+ to_remove = [font for font in fontManager.ttflist
190
191
+ for font in to_remove:
192
+ fontManager.ttflist.remove(font)
193
194
195
@pytest.mark.skipif(sys.platform != 'win32', reason='Windows only')
0 commit comments