Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit614093c

Browse files
committed
TST: Remove duplicate font tests
- matplotlib.tests.test_backend_pdf::test_embed_fonts is the same as `test_multi_font_type3` and `test_multi_font_type42`- matplotlib.tests.test_ft2font::test_font_fallback_chinese is the same as `test_fallback_smoke` except with Chinese fonts.
1 parentd48cc1c commit614093c

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

‎lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
)
1414
frommatplotlib.cbookimport_get_data_path
1515
frommatplotlib.ft2fontimportFT2Font
16-
frommatplotlib.font_managerimportfindfont,FontProperties
1716
frommatplotlib.backends._backend_pdf_psimportget_glyphs_subset,font_as_file
1817
frommatplotlib.backends.backend_pdfimportPdfPages
1918
frommatplotlib.patchesimportRectangle
@@ -42,22 +41,6 @@ def test_use14corefonts():
4241
ax.axhline(0.5,linewidth=0.5)
4342

4443

45-
@pytest.mark.parametrize('fontname, fontfile', [
46-
('DejaVu Sans','DejaVuSans.ttf'),
47-
('WenQuanYi Zen Hei','wqy-zenhei.ttc'),
48-
])
49-
@pytest.mark.parametrize('fonttype', [3,42])
50-
deftest_embed_fonts(fontname,fontfile,fonttype):
51-
ifPath(findfont(FontProperties(family=[fontname]))).name!=fontfile:
52-
pytest.skip(f'Font{fontname!r} may be missing')
53-
54-
rcParams['pdf.fonttype']=fonttype
55-
fig,ax=plt.subplots()
56-
ax.plot([1,2,3])
57-
ax.set_title('Axes Title',font=fontname)
58-
fig.savefig(io.BytesIO(),format='pdf')
59-
60-
6144
deftest_multipage_pagecount():
6245
withPdfPages(io.BytesIO())aspdf:
6346
assertpdf.get_pagecount()==0

‎lib/matplotlib/tests/test_ft2font.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
importmatplotlibasmpl
99
frommatplotlibimportft2font
1010
frommatplotlib.testingimport_gen_multi_font_text
11-
frommatplotlib.testing.decoratorsimportcheck_figures_equal
1211
importmatplotlib.font_managerasfm
1312
importmatplotlib.pathasmpath
1413
importmatplotlib.pyplotasplt
@@ -864,30 +863,6 @@ def test_fallback_smoke(fmt):
864863
fig.savefig(io.BytesIO(),format=fmt)
865864

866865

867-
@pytest.mark.parametrize('family_name, file_name',
868-
[("WenQuanYi Zen Hei","wqy-zenhei"),
869-
("Noto Sans CJK JP","NotoSansCJK"),
870-
("Noto Sans TC","NotoSansTC-Regular.otf")]
871-
)
872-
@check_figures_equal(extensions=["png","pdf","eps","svg"])
873-
deftest_font_fallback_chinese(fig_test,fig_ref,family_name,file_name):
874-
fp=fm.FontProperties(family=[family_name])
875-
iffile_namenotinPath(fm.findfont(fp)).name:
876-
pytest.skip(f"Font{family_name} ({file_name}) is missing")
877-
878-
text= ["There are","几个汉字","in between!"]
879-
880-
plt.rcParams["font.size"]=20
881-
test_fonts= [["DejaVu Sans",family_name]]*3
882-
ref_fonts= [["DejaVu Sans"], [family_name], ["DejaVu Sans"]]
883-
884-
forj, (txt,test_font,ref_font)inenumerate(
885-
zip(text,test_fonts,ref_fonts)
886-
):
887-
fig_ref.text(0.05,.85-0.15*j,txt,family=ref_font)
888-
fig_test.text(0.05,.85-0.15*j,txt,family=test_font)
889-
890-
891866
@pytest.mark.parametrize("font_list",
892867
[['DejaVu Serif','DejaVu Sans'],
893868
['DejaVu Sans Mono']],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp