Skip to content
Permalink
Browse files

[processing] Better debugging for failed tests

(cherry-picked from e83cd61)
  • Loading branch information
nyalldawson committed Apr 10, 2018
1 parent f30c162 commit f71590d4cc2480ca0c879c465c5bca780d9d16c0
Showing with 3 additions and 2 deletions.
  1. +3 −2 python/plugins/processing/tests/AlgorithmsTestBase.py
@@ -118,15 +118,15 @@ def check_algorithm(self, name, defs):
if expectFailure:
try:
results, ok = alg.run(parameters, context, feedback)
self.check_results(results, context, defs['params'], defs['results'])
self.check_results(results, context, parameters, defs['results'])
if ok:
raise _UnexpectedSuccess
except Exception:
pass
else:
results, ok = alg.run(parameters, context, feedback)
self.assertTrue(ok, 'params: {}, results: {}'.format(parameters, results))
self.check_results(results, context, defs['params'], defs['results'])
self.check_results(results, context, parameters, defs['results'])

def load_params(self, params):
"""
@@ -294,6 +294,7 @@ def check_results(self, results, context, params, expected):

elif 'rasterhash' == expected_result['type']:
print("id:{} result:{}".format(id, results[id]))
self.assertTrue(os.path.exists(results[id]), 'File does not exist: {}, {}'.format(results[id], params))
dataset = gdal.Open(results[id], GA_ReadOnly)
dataArray = nan_to_num(dataset.ReadAsArray(0))
strhash = hashlib.sha224(dataArray.data).hexdigest()

0 comments on commit f71590d

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