Enable WFS test with a fix to prevent crash on exit (#3774)

* Revert "Disable failing PyQgsOfflineEditingWFS test"

This reverts commit 33ee514b5dfdc1b57558cb9007df5b455a59fc17.

* Let lifetime of layers be controlled by QGIS
This commit is contained in:
Matthias Kuhn 2016-11-21 22:07:52 +01:00 committed by GitHub
parent ee710771e7
commit 22dc096692
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -37,7 +37,11 @@ from shutil import copytree, rmtree
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,
@ -133,6 +137,7 @@ class TestWFST(unittest.TestCase, OfflineTestBase):
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
@ -143,6 +148,7 @@ class TestWFST(unittest.TestCase, OfflineTestBase):
"""
path = cls.testdata_path + layer_name + '.shp'
layer = QgsVectorLayer(path, layer_name, "ogr")
layer.setParent(QgsAuthManager.instance())
assert layer.isValid()
return layer