mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
test_provider_ogr_gpkg.py: make test robust to GDAL exceptions turned on
This commit is contained in:
parent
150a0ac100
commit
40b7f136a5
@ -2323,7 +2323,8 @@ class TestPyQgsOGRProviderGpkg(QgisTestCase):
|
|||||||
|
|
||||||
tmpfile = os.path.join(
|
tmpfile = os.path.join(
|
||||||
self.basetestpath, 'testVectorLayerExporterDeferredSpatialIndex.gpkg')
|
self.basetestpath, 'testVectorLayerExporterDeferredSpatialIndex.gpkg')
|
||||||
gdal.Unlink(tmpfile)
|
if os.path.exists(tmpfile):
|
||||||
|
os.unlink(tmpfile)
|
||||||
options = {}
|
options = {}
|
||||||
options['driverName'] = 'GPKG'
|
options['driverName'] = 'GPKG'
|
||||||
options['layerName'] = 'table1'
|
options['layerName'] = 'table1'
|
||||||
@ -2442,7 +2443,10 @@ class TestPyQgsOGRProviderGpkg(QgisTestCase):
|
|||||||
|
|
||||||
ds = ogr.Open(tmpfile, update=1)
|
ds = ogr.Open(tmpfile, update=1)
|
||||||
gdal.PushErrorHandler()
|
gdal.PushErrorHandler()
|
||||||
|
try:
|
||||||
ds.ExecuteSQL('DROP TRIGGER gpkg_metadata_reference_column_name_update')
|
ds.ExecuteSQL('DROP TRIGGER gpkg_metadata_reference_column_name_update')
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
gdal.PopErrorHandler()
|
gdal.PopErrorHandler()
|
||||||
# inject wrong trigger on purpose
|
# inject wrong trigger on purpose
|
||||||
wrong_trigger = "CREATE TRIGGER 'gpkg_metadata_reference_column_name_update' " + \
|
wrong_trigger = "CREATE TRIGGER 'gpkg_metadata_reference_column_name_update' " + \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user