mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -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(
|
||||
self.basetestpath, 'testVectorLayerExporterDeferredSpatialIndex.gpkg')
|
||||
gdal.Unlink(tmpfile)
|
||||
if os.path.exists(tmpfile):
|
||||
os.unlink(tmpfile)
|
||||
options = {}
|
||||
options['driverName'] = 'GPKG'
|
||||
options['layerName'] = 'table1'
|
||||
@ -2442,7 +2443,10 @@ class TestPyQgsOGRProviderGpkg(QgisTestCase):
|
||||
|
||||
ds = ogr.Open(tmpfile, update=1)
|
||||
gdal.PushErrorHandler()
|
||||
ds.ExecuteSQL('DROP TRIGGER gpkg_metadata_reference_column_name_update')
|
||||
try:
|
||||
ds.ExecuteSQL('DROP TRIGGER gpkg_metadata_reference_column_name_update')
|
||||
except Exception:
|
||||
pass
|
||||
gdal.PopErrorHandler()
|
||||
# inject wrong trigger on purpose
|
||||
wrong_trigger = "CREATE TRIGGER 'gpkg_metadata_reference_column_name_update' " + \
|
||||
|
Loading…
x
Reference in New Issue
Block a user