We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 172a494 commit cccc22aCopy full SHA for cccc22a
lib/matplotlib/tests/test_backend_pdf.py
@@ -37,3 +37,23 @@ def test_type42():
37
ax = fig.add_subplot(111)
38
ax.plot([1,2,3])
39
fig.savefig(io.BytesIO())
40
+
41
42
+@cleanup
43
+def test_multipage_pagecount():
44
+ from matplotlib.backends.backend_pdf import PdfPages
45
+ from io import BytesIO
46
+ with PdfPages(BytesIO()) as pdf:
47
+ assert pdf.get_pagecount() == 0
48
+ fig = plt.figure()
49
+ ax = fig.add_subplot(111)
50
+ ax.plot([1, 2, 3])
51
+ fig.savefig(pdf, format="pdf")
52
+ assert pdf.get_pagecount() == 1
53
+ pdf.savefig()
54
+ assert pdf.get_pagecount() == 2
55
56
57
+if __name__ == '__main__':
58
+ import nose
59
+ nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
0 commit comments