MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_json_serialization

Function test_json_serialization

lib/matplotlib/tests/test_font_manager.py:86–98  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

84
85
86def test_json_serialization(tmp_path):
87 # Can't open a NamedTemporaryFile twice on Windows, so use a temporary
88 # directory instead.
89 json_dump(fontManager, tmp_path / "fontlist.json")
90 copy = json_load(tmp_path / "fontlist.json")
91 with warnings.catch_warnings():
92 warnings.filterwarnings('ignore', 'findfont: Font family.*not found')
93 for prop in ({'family': 'STIXGeneral'},
94 {'family': 'Bitstream Vera Sans', 'weight': 700},
95 {'family': 'no such font family'}):
96 fp = FontProperties(**prop)
97 assert (fontManager.findfont(fp, rebuild_if_missing=False) ==
98 copy.findfont(fp, rebuild_if_missing=False))
99
100
101def test_otf():

Callers

nothing calls this directly

Calls 4

json_dumpFunction · 0.90
json_loadFunction · 0.90
FontPropertiesClass · 0.90
findfontMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…