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

Function test_multipage_keep_empty

lib/matplotlib/tests/test_backend_pgf.py:313–324  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

311
312@needs_pgf_xelatex
313def test_multipage_keep_empty(tmp_path):
314 # An empty pdf deletes itself afterwards.
315 fn = tmp_path / "a.pdf"
316 with PdfPages(fn) as pdf:
317 pass
318 assert not fn.exists()
319
320 # Test pdf files with content, they should never be deleted.
321 fn = tmp_path / "b.pdf"
322 with PdfPages(fn) as pdf:
323 pdf.savefig(plt.figure())
324 assert fn.exists()
325
326
327@needs_pgf_xelatex

Callers

nothing calls this directly

Calls 3

PdfPagesClass · 0.90
figureMethod · 0.80
savefigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…