mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Avoid key error on fields which should be skipped
This commit is contained in:
parent
c975764c12
commit
1bdb35d630
@ -102,8 +102,6 @@ class TestCase(_TestCase):
|
||||
)
|
||||
|
||||
for attr_expected, field_expected in zip(feats[0].attributes(), layer_expected.fields().toList()):
|
||||
attr_result = feats[1][field_expected.name()]
|
||||
field_result = [fld for fld in layer_expected.fields().toList() if fld.name() == field_expected.name()][0]
|
||||
try:
|
||||
cmp = compare['fields'][field_expected.name()]
|
||||
except KeyError:
|
||||
@ -116,6 +114,9 @@ class TestCase(_TestCase):
|
||||
if 'skip' in cmp:
|
||||
continue
|
||||
|
||||
attr_result = feats[1][field_expected.name()]
|
||||
field_result = [fld for fld in layer_expected.fields().toList() if fld.name() == field_expected.name()][0]
|
||||
|
||||
# Cast field to a given type
|
||||
if 'cast' in cmp:
|
||||
if cmp['cast'] == 'int':
|
||||
|
Loading…
x
Reference in New Issue
Block a user