Skip to content

Commit

Permalink
Fix running tests where the same layer is used for multiple parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 1b692d3 commit b0994a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Expand Up @@ -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)
Expand Down

0 comments on commit b0994a5

Please sign in to comment.