File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
python/plugins/processing/tests Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 46
46
QgsMapLayerRegistry
47
47
)
48
48
49
+ from qgis .testing import _UnexpectedSuccess
50
+
49
51
from utilities import (
50
52
unitTestDataPath
51
53
)
@@ -65,7 +67,19 @@ def test_algorithms(self):
65
67
algorithm_tests = yaml .load (stream )
66
68
67
69
for algtest in algorithm_tests ['tests' ]:
68
- yield self .check_algorithm , algtest ['name' ], algtest
70
+ expectFailure = False
71
+ if 'expectedFailure' in algtest :
72
+ exec ('\n ' .join (algtest ['expectedFailure' ][:- 1 ]))
73
+ expectFailure = eval (algtest ['expectedFailure' ][- 1 ])
74
+ if expectFailure :
75
+ try :
76
+ yield self .check_algorithm , algtest ['name' ], algtest
77
+ except Exception :
78
+ pass
79
+ else :
80
+ raise _UnexpectedSuccess
81
+ else :
82
+ yield self .check_algorithm , algtest ['name' ], algtest
69
83
70
84
def check_algorithm (self , name , defs ):
71
85
"""
You can’t perform that action at this time.
0 commit comments