8000
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.
1 parent d141366 commit b28e4c1Copy full SHA for b28e4c1
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('mpltest.ttf')]
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