[Qgis-community-team] make doctest with default installation

matteo matteo.ghetta at gmail.com
Mon May 27 06:50:55 PDT 2019


Hi Arnauld,

> I suspect your QGIS_PREFIX_PATH is *NOT* properly configured.

something was stack somewhere (maybe in the cache I don't know), now is
working.

I'll ask you another thing related to the tests. With a simple test like:

.. testcode::

   exp = QgsExpression('1 + 1 = 2')

.. testoutput::

   assert(not exp.hasParserError())

I have local failing because of:

**********************************************************************
File "docs/pyqgis_developer_cookbook/expressions.rst", line 169, in default
Failed example:
    exp = QgsExpression('1 + 1 = 2')
Expected:
    assert(not exp.hasParserError())
Got nothing


and actually it is right. Putting the code in the python console,
assert(not exp.hasParserError()) gives NO output.

Are better asserts to use (assertTrue or similar?). Just asking because
it would be nice to have a good testing framework.

Cheers and thanks

Matteo



More information about the Qgis-community-team mailing list