Skip to content

Commit 6c46e47

Browse files
committed
Fix failing unit test
Wow... how did that test ever work? Very odd...
1 parent ff15896 commit 6c46e47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/src/python/test_provider_shapefile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -569,15 +569,15 @@ def testRepackAtFirstSave(self):
569569
ds = None
570570

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

0 commit comments

Comments
 (0)