10000 Try forcing font cache rebuild in flaky ttc test. by anntzer · Pull Request #13331 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Try forcing font cache rebuild in flaky ttc test. #13331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy as np
import pytest

from matplotlib import font_manager as fm
from matplotlib.font_manager import (
findfont, findSystemFonts, FontProperties, fontManager, json_dump,
json_load, get_font, get_fontconfig_fonts, is_opentype_cff_font,
Expand Down Expand Up @@ -114,12 +115,11 @@ def test_utf16m_sfnt():
reason="Font may be missing.")
def test_find_ttc():
fp = FontProperties(family=["WenQuanYi Zen Hei"])
font = findfont(fp)
if Path(font).name != "wqy-zenhei.ttc":
# This test appears to be flaky on Travis... investigate it.
print("system fonts:")
print(*findSystemFonts(), sep="\n")
pytest.fail("Failed to find wqy-zenhei.ttc")
if Path(findfont(fp)).name != "wqy-zenhei.ttc":
# Travis appears to fail to pick up the ttc file sometimes. Try to
# rebuild the cache and try again.
fm._rebuild()
assert Path(findfont(fp)).name == "wqy-zenhei.ttc"

fig, ax = plt.subplots()
ax.text(.5, .5, "\N{KANGXI RADICAL DRAGON}", fontproperties=fp)
Expand Down
0