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

Function test_ft2font_valid_args

lib/matplotlib/tests/test_ft2font.py:138–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137
138def test_ft2font_valid_args():
139 class PathLikeClass:
140 def __init__(self, filename):
141 self.filename = filename
142
143 def __fspath__(self):
144 return self.filename
145
146 file_str = fm.findfont('DejaVu Sans')
147 file_bytes = os.fsencode(file_str)
148
149 font = ft2font.FT2Font(file_str)
150 assert font.fname == file_str
151 font = ft2font.FT2Font(file_bytes)
152 assert font.fname == file_bytes
153 font = ft2font.FT2Font(PathLikeClass(file_str))
154 assert font.fname == file_str
155 font = ft2font.FT2Font(PathLikeClass(file_bytes))
156 assert font.fname == file_bytes
157
158
159def test_ft2font_invalid_args(tmp_path):

Callers

nothing calls this directly

Calls 2

findfontMethod · 0.80
PathLikeClassClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…