John Hunter wrote: > On Wed, Sep 23, 2009 at 12:42 PM, Andrew Straw <straw...@astraw.com> wrote: > > >> Sorry, I should have been more clear. I was thinking that the >> image_compare() decorator would call the test function multiple times, >> having switched the backend between invocations. Thus, the call to >> savefig() would continue not to explicitly set the extension. I've >> quickly modified the source to reflect my idea, but I haven't had a >> chance to flesh it out or test it. It should show the idea, though. See >> attached. >> > > Why not have the decorator pass the extension in to the test funcs -- > agg can print to pdf, ps, svg and png > I'm not sure what you're suggesting. Presumably if we're driving agg OK to draw .png, it will also draw .pdf OK (or does it have a pdf vector backend independent of the MPL pdf backend that we want to test separately?)
I was just thinking it would be easiest to have test functions that look like: @image_comparison('my_figure') def my_figure_test(): plt.plot([1,2,3],[4,5,6]) plt.savefig('my_figure') This could automatically test all backends we have the infrastructure and the baseline images for. It doesn't force the test writer to worry about that stuff. -Andrew ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel