(tmp_path)
| 311 | |
| 312 | @needs_pgf_xelatex |
| 313 | def 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 |