[Qgis-developer] How to debug failing python tests ?

Larry Shaffer larrys at dakotacarto.com
Sun Dec 7 18:55:55 PST 2014

Hi Sandro,

On Sun, Dec 7, 2014 at 3:39 AM, Sandro Santilli <strk at keybit.net> wrote:

> I'm trying to understand why PAL labelling tests fail on my machine
> and for the nightlies but succeed on travis.
> But if I run:
>   /usr/bin/python tests/src/python/test_qgspallabeling_composer.py
> All I get as a report are messages like this:
>   ======================================================================
>   FAIL: test_background_rect (__main__.TestComposerPdfPoint)
>   ----------------------------------------------------------------------
>   Traceback (most recent call last):
>     File "tests/src/python/test_qgspallabeling_tests.py", line 77, in
> test_background_rect
>       self.checkTest()
>     File "tests/src/python/test_qgspallabeling_composer.py", line 305, in
> checkTest
>       imgpath=self._TestImage))
>   AssertionError:
>   Render check failed for "sp_pdf_background_rect"
> The message doesn't tell me the paths to the expected and obtained image
> nor the used tolerance to compare the two. Is there a commandline switch
> that I'm missing to get that info ?

I have added several environment variable controls for getting data out of
the labeling engine tests.

See: https://github.com/qgis/QGIS/tree/master/tests/testdata/labeling

You will want to turn on PAL_VERBOSE, PAL_REPORT, and PAL_SUITE, then edit
test_qgspallabeling_tests.py or other test_qgspallabeling_*.py files to
have full control over which test are run (if needed). Just remember not to
push upstream any session/debugging edits you have made to the
test_qgspallabeling_*.py files.

Specifically, PAL_REPORT will generate an HTML report, similar to that
which is uploaded to CDash, for all failed tests. You can use those images
from the report for any acceptable control image anomalies, if needed.


Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

> --strk;
>  ()  ASCII ribbon campaign  --  Keep it simple !
>  /\  http://strk.keybit.net/rants/ascii_mails.txt
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141207/94060625/attachment.html>

More information about the Qgis-developer mailing list