Skip to content

Commit 22dc096

Browse files
authoredNov 21, 2016
Enable WFS test with a fix to prevent crash on exit (#3774)
* Revert "Disable failing PyQgsOfflineEditingWFS test" This reverts commit 33ee514. * Let lifetime of layers be controlled by QGIS
1 parent ee71077 commit 22dc096

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎ci/travis/linux/script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2525
export OTB_APPLICATION_PATH=${HOME}/OTB-5.6.0-Linux64/lib/otb/applications
2626
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
2727

28-
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
28+
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
2929
# xvfb-run ctest -V -E "qgis_openstreetmaptest|qgis_wcsprovidertest" -S ./qgis-test-travis.ctest --output-on-failure

‎tests/src/python/test_offline_editing_wfs.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
import tempfile
3838
from time import sleep
3939
from utilities import unitTestDataPath, waitServer
40-
from qgis.core import QgsVectorLayer
40+
from qgis.core import (
41+
QgsVectorLayer,
42+
QgsMapLayerRegistry,
43+
QgsAuthManager
44+
)
4145

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

@@ -143,6 +148,7 @@ def _getLayer(cls, layer_name):
143148
"""
144149
path = cls.testdata_path + layer_name + '.shp'
145150
layer = QgsVectorLayer(path, layer_name, "ogr")
151+
layer.setParent(QgsAuthManager.instance())
146152
assert layer.isValid()
147153
return layer
148154

0 commit comments

Comments
 (0)
Please sign in to comment.