From: Andrew S. <str...@as...> - 2009-10-02 05:27:46
|
Jouni K. Seppänen wrote: > Jouni K. Seppänen <jk...@ik...> writes: > > >> I committed something based on this, and a new rc parameter >> savefig.extension that sets the filename extension when you call savefig >> with a bare filename. The pdf tests seem to be working, at least for me, >> but I am sure that the code can be improved. >> > > The buildbot was getting errors, since the build environments don't have > gs. I changed the tests so that this isn't an error. It might be better > to make it a known fail, but is it possible for the image comparison > decorator to turn one test function into several cases? I.e., the png > case could be pass/fail, and the pdf case a known fail if there is no > Ghostscript. > Hi Jouni, I just installed gs on one of the buildbots -- so at least the .pdf generation should get tested on one machine. (The one running the py24 and py25 tests.) As far as the decorator turning one test in into multiple tests out -- it may be possible. Nose does this automatically for tests like: def check_sum(func): a = 10; b = 20 assert a+b == func(a,b) def test_sum(): for func in [np.add, pylab.add]: yield check_sum, func This test function is a generator that nose will then generate two test cases out of. So, perhaps the image_comparison decorator could be changed to become a generator? I'm not 100% sure it will work, but I don't see why it won't. If it does work, I think this is a good idea. -Andrew |