File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import io
22import pathlib
3+ import warnings
34
45import numpy as np
56from numpy .testing import assert_array_almost_equal
@@ -355,12 +356,18 @@ def test_chunksize_toobig_chunks(chunk_limit_setup):
355356
356357@image_comparison (["font_fallback.png" ])
357358def test_font_fallback ():
358- fp = fm .FontProperties (family = ["Noto Sans CJK JP" ])
359+ fp = fm .FontProperties (family = ["Noto Sans CJK SC" , "Noto Sans CJK JP" ])
359360 name = pathlib .Path (fm .findfont (fp )).name
360361 if name not in ("NotoSansCJKsc-Regular.otf" , "NotoSansCJK-Regular.ttc" ):
361- pytest .skip (f"Noto Sans CJK JP font may be missing, found: { name } " )
362+ pytest .skip (f"Noto Sans CJK SC font may be missing, found: { name } " )
362363
363- plt .rc ('font' , family = ['DejaVu Sans' , 'Noto Sans CJK JP' ], size = 15 )
364+ plt .rc ('font' , family = [
365+ 'DejaVu Sans' , 'Noto Sans CJK JP' , 'Noto Sans CJK SC'
366+ ], size = 15 )
364367
365368 fig , ax = plt .subplots ()
366369 ax .text (0.25 , 0.475 , "There are 多个汉字 in between!" )
370+
371+ with warnings .catch_warnings ():
372+ warnings .filterwarnings ('ignore' , 'findfont: Font family.*not found' )
373+ fig .canvas .draw ()
You can’t perform that action at this time.
0 commit comments