Skip to content
Permalink
Browse files

Fix running tests where the same layer is used for multiple parameters

  • Loading branch information
nyalldawson committed Feb 5, 2021
1 parent 085e871 commit 364f960a09092d65e646a97ff49304a1e6b8b955
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/tests/AlgorithmsTestBase.py
@@ -251,15 +251,15 @@ def load_layer(self, id, param):
self.in_place_layers[id] = filepath

if param['type'] in ('vector', 'table'):
if filepath in self.vector_layer_params:
return self.vector_layer_params[filepath]

gmlrex = r'\.gml\b'
if re.search(gmlrex, filepath, re.IGNORECASE):
# ewwwww - we have to force SRS detection for GML files, otherwise they'll be loaded
# with no srs
filepath += '|option:FORCE_SRS_DETECTION=YES'

if filepath in self.vector_layer_params:
return self.vector_layer_params[filepath]

options = QgsVectorLayer.LayerOptions()
options.loadDefaultStyle = False
lyr = QgsVectorLayer(filepath, param['name'], 'ogr', options)

0 comments on commit 364f960

Please sign in to comment.