Skip to content


Browse files Browse the repository at this point in the history
Make test layer comparison handle different order of features
(cherry-picked from f449bf2)
  • Loading branch information
nyalldawson committed Aug 10, 2016
1 parent 069ed71 commit 5ac4d0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/testing/
Expand Up @@ -72,7 +72,10 @@ def assertLayersEqual(self, layer_expected, layer_result, **kwargs):
except KeyError:
precision = 17

for feats in zip(layer_expected.getFeatures(request), layer_result.getFeatures(request)):
expected_features = sorted(layer_expected.getFeatures(request), key=lambda f:
result_features = sorted(layer_expected.getFeatures(request), key=lambda f:

for feats in zip(expected_features, result_features):
if feats[0].geometry() is not None:
geom0 = feats[0].geometry().geometry().asWkt(precision)
Expand Down

0 comments on commit 5ac4d0e

Please sign in to comment.