Skip to content
Permalink
Browse files

Fix failing unit test

Wow... how did that test ever work? Very odd...
  • Loading branch information
nyalldawson committed Dec 15, 2017
1 parent ff15896 commit 6c46e47c7c6cb98a0128d40385dd67b859c6dfc1
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/src/python/test_provider_shapefile.py
@@ -569,15 +569,15 @@ def testRepackAtFirstSave(self):
ds = None

def testOpenWithFilter(self):
file_path = os.path.join(TEST_DATA_DIR, 'provider')
file_path = os.path.join(TEST_DATA_DIR, 'provider', 'shapefile.shp')
uri = '{}|layerid=0|subset="name" = \'Apple\''.format(file_path)
# ensure that no longer required ogr SQL layers are correctly cleaned up
# we need to run this twice for the incorrect cleanup asserts to trip,
# since they are triggered only when fetching an existing layer from the ogr
# connection pool
for i in range(2):
vl = QgsVectorLayer(uri)
self.assertTrue(vl.isValid())
self.assertTrue(vl.isValid(), 'Layer not valid, iteration {}'.format(i + 1))
self.assertEqual(vl.featureCount(), 1)
f = next(vl.getFeatures())
self.assertEqual(f['name'], 'Apple')

0 comments on commit 6c46e47

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