Skip to content


Fix failing unit test
Browse files Browse the repository at this point in the history
Wow... how did that test ever work? Very odd...
  • Loading branch information
nyalldawson committed Dec 15, 2017
1 parent ff15896 commit 6c46e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/src/python/
Expand Up @@ -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(), 'Layer not valid, iteration {}'.format(i + 1))
self.assertEqual(vl.featureCount(), 1)
f = next(vl.getFeatures())
self.assertEqual(f['name'], 'Apple')
Expand Down

0 comments on commit 6c46e47

Please sign in to comment.