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

matteo matteo.ghetta at gmail.com
Mon May 27 03:30:39 PDT 2019


Hi Arnauld,

> Seems that the virtual environment exists, but does not contains pip.

that's weird..
> Try to remove folder "venv" and try again (it should create a new fresh
> one).

yep, working now, thanks!

BTW now I get a bunch of errors from the code snippet, like:


Application path not initialized
**********************************************************************
File "docs/pyqgis_developer_cookbook/crs.rst", line 71, in default
Failed example:
    # PostGIS SRID 4326 is allocated for WGS84
    crs = QgsCoordinateReferenceSystem(4326,
QgsCoordinateReferenceSystem.PostgisCrsId)
    assert crs.isValid()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.7/doctest.py", line 1329, in __run
        compileflags, 1), test.globs)
      File "<doctest default[0]>", line 3, in <module>
        assert crs.isValid()
    AssertionError
Application path not initialized


The snippet is correct (trying it in the python console of QGIS the
assert is valid), so I think something is going on with "Application
path not initialized"

Other magic suggestions :) ?

Thanks again

Matteo


More information about the Qgis-community-team mailing list