##// END OF EJS Templates
add unittest for jpg, only activated if PIL/Pillow is installed
Daniel B. Vasquez -
Show More
@@ -53,6 +53,19 b' def test_figure_to_svg():'
53 svg = pt.print_figure(fig, 'svg')[:100].lower()
53 svg = pt.print_figure(fig, 'svg')[:100].lower()
54 nt.assert_in(b'doctype svg', svg)
54 nt.assert_in(b'doctype svg', svg)
55
55
56 try:
57 from PIL import Image
58 def test_figure_to_jpg():
59 # simple check for at least svg-looking output
60 fig = plt.figure()
61 ax = fig.add_subplot(1,1,1)
62 ax.plot([1,2,3])
63 plt.draw()
64 jpg = pt.print_figure(fig, 'jpg')[:100].lower()
65 assert jpg.startswith(b'\xff\xd8')
66 except ImportError:
67 pass
68
56
69
57 def test_import_pylab():
70 def test_import_pylab():
58 ip = get_ipython()
71 ip = get_ipython()
General Comments 0
You need to be logged in to leave comments. Login now