Skip to content

Commit

Permalink
Add ugly debug prints to try to find what is travis-ci problem...
Browse files Browse the repository at this point in the history
  • Loading branch information
Médéric Ribreux authored and Médéric RIBREUX committed May 29, 2016
1 parent bc4b3a2 commit 8884cd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def check_algorithm(self, name, defs):
:param defs: A python dict containing a test algorithm definition
"""
QgsMapLayerRegistry.instance().removeAllMapLayers()

print('DEBUG on {}'.format(name))
print('Params = {}'.format(defs))
params = self.load_params(defs['params'])
alg = processing.Processing.getAlgorithm(defs['algorithm']).getCopy()

Expand Down Expand Up @@ -168,7 +169,6 @@ def load_layer(self, param):
Loads a layer which was specified as parameter.
"""
filepath = self.filepath_from_param(param)

if param['type'] == 'vector':
lyr = QgsVectorLayer(filepath, param['name'], 'ogr')
elif param['type'] == 'raster':
Expand All @@ -185,13 +185,14 @@ def filepath_from_param(self, param):
prefix = processingTestDataPath()
if 'location' in param and param['location'] == 'qgs':
prefix = unitTestDataPath()

print('DEBUG filepath_from_param: {} -> {}'.format(param['name'], os.path.join(prefix, param['name'])))
return os.path.join(prefix, param['name'])

def check_results(self, results, expected):
"""
Checks if result produced by an algorithm matches with the expected specification.
"""
print('DEBUG check_results: results {}\n\texpected {}'.format(results, expected))
for id, expected_result in expected.items():
if 'vector' == expected_result['type']:
expected_lyr = self.load_layer(expected_result)
Expand Down

0 comments on commit 8884cd7

Please sign in to comment.