From 6f5356eb7ffcb8fd17b76c69e9006ed297c34dc2 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Mon, 20 Feb 2017 14:41:21 +0100 Subject: [PATCH] fix postgis test --- test/python_tests/postgis_test.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/python_tests/postgis_test.py b/test/python_tests/postgis_test.py index bafda2036..a03d3a147 100644 --- a/test/python_tests/postgis_test.py +++ b/test/python_tests/postgis_test.py @@ -728,7 +728,7 @@ def create_ds(): table='test', max_size=20, geometry_field='geom') - fs = ds.all_features() + fs = list(ds.all_features()) eq_(len(fs), 8) meta = ds.describe() @@ -967,8 +967,7 @@ def test_psql_error_should_not_break_connection_pool(): failed = False try: fs = ds_bad.featureset() - for feature in fs.features: - pass + count = sum(1 for f in fs) except RuntimeError as e: assert 'invalid input syntax for integer' in str(e) failed = True @@ -977,9 +976,7 @@ def test_psql_error_should_not_break_connection_pool(): # Should be ok fs = ds_good.featureset() - count = 0 - for feature in fs.features: - count += 1 + count = sum(1 for f in fs) eq_(count, 8) def test_psql_error_should_give_back_connections_opened_for_lower_layers_to_the_pool():