Skip to content
Permalink
Browse files

Allow expectedFailure in processing tests

  • Loading branch information
m-kuhn committed Mar 4, 2016
1 parent 5a18bb6 commit db2ca3aaa29dd48c6fccf8b2dd0500536f9bff6a
Showing with 15 additions and 1 deletion.
  1. +15 −1 python/plugins/processing/tests/AlgorithmsTestBase.py
@@ -46,6 +46,8 @@
QgsMapLayerRegistry
)

from qgis.testing import _UnexpectedSuccess

from utilities import (
unitTestDataPath
)
@@ -65,7 +67,19 @@ def test_algorithms(self):
algorithm_tests = yaml.load(stream)

for algtest in algorithm_tests['tests']:
yield self.check_algorithm, algtest['name'], algtest
expectFailure = False
if 'expectedFailure' in algtest:
exec('\n'.join(algtest['expectedFailure'][:-1]))
expectFailure = eval(algtest['expectedFailure'][-1])
if expectFailure:
try:
yield self.check_algorithm, algtest['name'], algtest
except Exception:
pass
else:
raise _UnexpectedSuccess
else:
yield self.check_algorithm, algtest['name'], algtest

def check_algorithm(self, name, defs):
"""

0 comments on commit db2ca3a

Please sign in to comment.
You can’t perform that action at this time.