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

Function test_truncated_file

lib/matplotlib/tests/test_png.py:29–39  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

27
28
29def test_truncated_file(tmp_path):
30 path = tmp_path / 'test.png'
31 path_t = tmp_path / 'test_truncated.png'
32 plt.savefig(path)
33 with open(path, 'rb') as fin:
34 buf = fin.read()
35 with open(path_t, 'wb') as fout:
36 fout.write(buf[:20])
37
38 with pytest.raises(Exception):
39 plt.imread(path_t)
40
41
42def test_truncated_buffer():

Callers

nothing calls this directly

Calls 2

savefigMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…