From fb604926965cf8d1f91bfd58a459e08814cdf331 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 24 Sep 2014 17:36:50 -0700 Subject: [PATCH] skip load/save map tests when postgis is not running --- tests/python_tests/load_map_test.py | 3 ++- tests/python_tests/save_map_test.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/python_tests/load_map_test.py b/tests/python_tests/load_map_test.py index f7f2d1f00..106981df2 100644 --- a/tests/python_tests/load_map_test.py +++ b/tests/python_tests/load_map_test.py @@ -51,7 +51,8 @@ def test_good_files(): mapnik.load_map_from_string(m,open(filename,'rb').read(),strict,base_path) except RuntimeError, e: # only test datasources that we have installed - if not 'Could not create datasource' in str(e): + if not 'Could not create datasource' in str(e) \ + and not 'Bad connection' in str(e): failures.append('Failed to load valid map %s (%s)' % (filename,e)) eq_(len(failures),0,'\n'+'\n'.join(failures)) diff --git a/tests/python_tests/save_map_test.py b/tests/python_tests/save_map_test.py index 6af8597e7..4df244d98 100644 --- a/tests/python_tests/save_map_test.py +++ b/tests/python_tests/save_map_test.py @@ -26,7 +26,8 @@ def compare_map(xml): mapnik.load_map(m, xml, False, absolute_base) except RuntimeError, e: # only test datasources that we have installed - if not 'Could not create datasource' in str(e): + if not 'Could not create datasource' in str(e) \ + and not 'Bad connection' in str(e): raise RuntimeError(str(e)) return (handle, test_map) = tempfile.mkstemp(suffix='.xml', prefix='mapnik-temp-map1-')