Skip to content

Commit

Permalink
Enable WFS test with a fix to prevent crash on exit (#3774)
Browse files Browse the repository at this point in the history
* Revert "Disable failing PyQgsOfflineEditingWFS test"

This reverts commit 33ee514.

* Let lifetime of layers be controlled by QGIS
  • Loading branch information
m-kuhn authored Nov 21, 2016
1 parent ee71077 commit 22dc096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/travis/linux/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export OTB_APPLICATION_PATH=${HOME}/OTB-5.6.0-Linux64/lib/otb/applications
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so

xvfb-run ctest -V -E "qgis_filedownloader|qgis_openstreetmaptest|qgis_wcsprovidertest|PyQgsWFSProviderGUI|PyQgsOfflineEditingWFS|qgis_ziplayertest|$(cat ${DIR}/blacklist.txt | paste -sd '|' -)" -S ./qgis-test-travis.ctest --output-on-failure
xvfb-run ctest -V -E "qgis_filedownloader|qgis_openstreetmaptest|qgis_wcsprovidertest|PyQgsWFSProviderGUI|qgis_ziplayertest|$(cat ${DIR}/blacklist.txt | paste -sd '|' -)" -S ./qgis-test-travis.ctest --output-on-failure
# xvfb-run ctest -V -E "qgis_openstreetmaptest|qgis_wcsprovidertest" -S ./qgis-test-travis.ctest --output-on-failure
8 changes: 7 additions & 1 deletion tests/src/python/test_offline_editing_wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
import tempfile
from time import sleep
from utilities import unitTestDataPath, waitServer
from qgis.core import QgsVectorLayer
from qgis.core import (
QgsVectorLayer,
QgsMapLayerRegistry,
QgsAuthManager
)

from qgis.testing import (
start_app,
Expand Down Expand Up @@ -133,6 +137,7 @@ def _getOnlineLayer(self, type_name, layer_name=None):
self.counter += 1
uri = ' '.join([("%s='%s'" % (k, v)) for k, v in list(parms.items())])
wfs_layer = QgsVectorLayer(uri, layer_name, 'WFS')
wfs_layer.setParent(QgsAuthManager.instance())
assert wfs_layer.isValid()
return wfs_layer

Expand All @@ -143,6 +148,7 @@ def _getLayer(cls, layer_name):
"""
path = cls.testdata_path + layer_name + '.shp'
layer = QgsVectorLayer(path, layer_name, "ogr")
layer.setParent(QgsAuthManager.instance())
assert layer.isValid()
return layer

Expand Down

0 comments on commit 22dc096

Please sign in to comment.