From: Eduard B. <edu...@ae...> - 2013-10-10 13:00:45
|
Hello, I am developing a toolkit to parse, analyse and plot some scientific data using matplotlib. Among them are some application-specific plotting functions that sort of extend matplotlib. There are these nice image comparison decorators to test code like that but I am not sure how to use them for unit testing outside the scope of matplotlib itself. Is this use case intended and possible for the decorator? I have experimented with this unsuccessfully in the following way: There is a tests directory within my package with test functions decorated like so @image_comparison(baseline_images=['custom_function']) def test_custom_function(): # plot stuff... When I run nosetests, it fails creating some output images in result_images. Copying the appropriate files according to [1] to my_package/tests/baseline_images does not seem to have any effect. There are neither *-expected* nor *_{pdf,svg}.png files in there, only custom_function.{pdf,svg,png}. What am I doing wrong? Eduard [1] http://matplotlib.org/devel/testing.html |