(tmp_path)
| 84 | |
| 85 | |
| 86 | def 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 | |
| 101 | def test_otf(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…