Skip to content

Commit 37a6856

Browse files
committed
A bit more tolerance in provider test
1 parent 972250d commit 37a6856

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/src/python/providertestbase.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,10 @@ def testMinMaxAfterChanges(self):
876876

877877
if vl.dataProvider().capabilities() & QgsVectorDataProvider.DeleteAttributes:
878878
# delete attributes
879-
self.assertTrue(vl.dataProvider().deleteAttributes([0]))
880-
self.assertEqual(vl.dataProvider().minimumValue(0), -200)
881-
self.assertEqual(vl.dataProvider().maximumValue(0), 400)
879+
if vl.dataProvider().deleteAttributes([0]):
880+
# may not be possible, e.g. if it's a primary key
881+
self.assertEqual(vl.dataProvider().minimumValue(0), -200)
882+
self.assertEqual(vl.dataProvider().maximumValue(0), 400)
882883

883884
def testStringComparison(self):
884885
"""

0 commit comments

Comments
 (0)