Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 684db70

Browse files
committed
TST : force re-building of font-cache
- there should be a better way to do this, this will get the tests passing again.
1 parent e37b5c5 commit 684db70

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/matplotlib/tests/test_font_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66

77
import os
88

9-
from matplotlib.font_manager import findfont, FontProperties
9+
from matplotlib.font_manager import findfont, FontProperties, _rebuild
1010
from matplotlib import rc_context
1111

1212

1313
def test_font_priority():
1414
with rc_context(rc={
1515
'font.sans-serif':
1616
['cmmi10', 'Bitstream Vera Sans']}):
17+
# force the font manager to rebuild it self
18+
_rebuild()
1719
font = findfont(
1820
FontProperties(family=["sans-serif"]))
1921
assert_equal(os.path.basename(font), 'cmmi10.ttf')
22+
# force it again
23+
_rebuild()

0 commit comments

Comments
 (0)