From b6bd5d744e60009dbbace17cd5d1d46b14ce3246 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 3 Sep 2014 12:29:10 -0700 Subject: [PATCH] travis: more debugging of mapnik-test-data --- tests/python_tests/mapnik_test_data_test.py | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tests/python_tests/mapnik_test_data_test.py b/tests/python_tests/mapnik_test_data_test.py index 328ad3d3a..8fc1cf25f 100644 --- a/tests/python_tests/mapnik_test_data_test.py +++ b/tests/python_tests/mapnik_test_data_test.py @@ -34,19 +34,27 @@ def test_opening_data(): if os.path.exists('../data/mapnik-test-data/'): files = glob('../data/mapnik-test-data/data/*/*.*') for filepath in files: - if 'topo' in filepath: - kwargs = {'type': 'ogr','file': filepath} - kwargs['layer_by_index'] = 0 - ds = mapnik.Datasource(**kwargs) - else: - ext = os.path.splitext(filepath)[1] - if plugin_mapping.get(ext): + ext = os.path.splitext(filepath)[1] + if plugin_mapping.get(ext): + print 'testing opening %s' % filepath + if 'topo' in filepath: + kwargs = {'type': 'ogr','file': filepath} + kwargs['layer_by_index'] = 0 + try: + ds = mapnik.Datasource(**kwargs) + except Exception, e: + print 'could not open, %s: %s' % (kwargs,e) + else: for plugin in plugin_mapping[ext]: kwargs = {'type': plugin,'file': filepath} if plugin is 'ogr': kwargs['layer_by_index'] = 0 - print kwargs - ds = mapnik.Datasource(**kwargs) + try: + ds = mapnik.Datasource(**kwargs) + except Exception, e: + print 'could not open, %s: %s' % (kwargs,e) + else: + print 'skipping opening %s' % filepath if __name__ == "__main__": setup()