Skip to content
Permalink
Browse files
[processing] Don't use config values for invalid geometry handling in…
… tests
  • Loading branch information
nyalldawson committed Apr 26, 2017
1 parent a28bc08 commit 91679b3cbda76a18ca78c2c36c68bd7f40252c4b
Showing with 8 additions and 3 deletions.
  1. +8 −3 python/plugins/processing/tests/AlgorithmsTestBase.py
@@ -61,7 +61,8 @@
from qgis.core import (QgsVectorLayer,
QgsRasterLayer,
QgsProject,
QgsApplication)
QgsApplication,
QgsProcessingContext)

from qgis.testing import _UnexpectedSuccess

@@ -117,16 +118,20 @@ def check_algorithm(self, name, defs):
exec(('\n'.join(defs['expectedFailure'][:-1])), globals(), locals())
expectFailure = eval(defs['expectedFailure'][-1])

# ignore user setting for invalid geometry handling
context = QgsProcessingContext()
context.setProject(QgsProject.instance())

if expectFailure:
try:
alg.execute()
alg.execute(context)
self.check_results(alg.getOutputValuesAsDictionary(), defs['params'], defs['results'])
except Exception:
pass
else:
raise _UnexpectedSuccess
else:
alg.execute()
alg.execute(context)
self.check_results(alg.getOutputValuesAsDictionary(), defs['params'], defs['results'])

def load_params(self, params):

0 comments on commit 91679b3

Please sign in to comment.