[Matplotlib-users] Graphic tests working with single files but not at package level

Fabien fabien.maussion at gmail.com
Thu Aug 20 13:42:50 CEST 2015


Folks,

I have two test files for a small personnal project. Both make use of 
the @image_comparison decorator to compare expected images to the outcome.

When run on single files as follows, everything works fine:

(py2) $ nosetests cleo/tests/test_colors.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.414s

OK
(py2) $ nosetests cleo/tests/test_graphics.py
.....
----------------------------------------------------------------------
Ran 5 tests in 2.781s

OK

But when I run nose at the package level, I get an error:


(py2) $ nosetests .
..F....
======================================================================
FAIL: cleo.tests.test_graphics.test_DataLevels_graphics.test
----------------------------------------------------------------------
(...)
ImageComparisonFailure: images not close: 
/home/mowglie/Documents/git/cleo/result_images/test_graphics/test_DataLevels.png 
vs. 
/home/mowglie/Documents/git/cleo/result_images/test_graphics/test_DataLevels-expected.png 
(RMS 25.865)

----------------------------------------------------------------------
Ran 7 tests in 3.685s

FAILED (failures=1)


An inspection of the failing test shows that the title and axis 
characters are slightly shifted, while the image plots (made with 
imshow) look exact same. I am pretty sure that I made no change to 
matplotlib's defaut params or whatsoever. I have the same behavior with 
python 2 and 3.

Any idea what I could have done wrong?

Thanks a lot,

Fabien




More information about the Matplotlib-users mailing list