Skip to content

Commit 2969ba1

Browse files
committed
test_provider_ogr_gpkg.py: avoid bug_17795.gpkg test sample to be modified by tests
1 parent ee06d52 commit 2969ba1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/src/python/test_provider_ogr_gpkg.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,11 @@ def testCreateSpatialIndex(self):
841841
def testSubSetStringEditable_bug17795(self):
842842
"""Test that a layer is not editable after setting a subset and it's reverted to editable after the filter is removed"""
843843

844+
tmpfile = os.path.join(self.basetestpath, 'testSubSetStringEditable_bug17795.gpkg')
845+
shutil.copy(TEST_DATA_DIR + '/' + 'provider/bug_17795.gpkg', tmpfile)
846+
844847
isEditable = QgsVectorDataProvider.ChangeAttributeValues
845-
testPath = TEST_DATA_DIR + '/' + 'provider/bug_17795.gpkg|layername=bug_17795'
848+
testPath = tmpfile + '|layername=bug_17795'
846849

847850
vl = QgsVectorLayer(testPath, 'subset_test', 'ogr')
848851
self.assertTrue(vl.isValid())
@@ -868,7 +871,10 @@ def testSubsetStringExtent_bug17863(self):
868871
def _lessdigits(s):
869872
return re.sub(r'(\d+\.\d{3})\d+', r'\1', s)
870873

871-
testPath = TEST_DATA_DIR + '/' + 'provider/bug_17795.gpkg|layername=bug_17795'
874+
tmpfile = os.path.join(self.basetestpath, 'testSubsetStringExtent_bug17863.gpkg')
875+
shutil.copy(TEST_DATA_DIR + '/' + 'provider/bug_17795.gpkg', tmpfile)
876+
877+
testPath = tmpfile + '|layername=bug_17795'
872878
subSetString = '"name" = \'int\''
873879
subSet = '|layername=bug_17795|subset=%s' % subSetString
874880

0 commit comments

Comments
 (0)