Skip to content
Permalink
Browse files

improve geometry equality report in tests (#39772)

  • Loading branch information
3nids committed Nov 3, 2020
1 parent 1fbba79 commit 7d1ca8161882cf03b9a384b6e294fc9ce5f45ed8
Showing with 13 additions and 3 deletions.
  1. +13 −3 python/testing/__init__.py
@@ -230,12 +230,22 @@ def checkGeometriesEqual(self, geom0, geom1, geom0_id, geom1_id, use_asserts=Fal
if use_asserts:
_TestCase.assertTrue(
self,
equal,
'Features (Expected fid: {}, Result fid: {}) differ in geometry: \n\n Expected geometry:\n {}\n\n Result geometry:\n {}'.format(
equal, ''
' Features (Expected fid: {}, Result fid: {}) differ in geometry with method {}: \n\n'
' At given precision ({}):\n'
' Expected geometry: {}\n'
' Result geometry: {}\n\n'
' Full precision:\n'
' Expected geometry : {}\n'
' Result geometry: {}\n\n'.format(
geom0_id,
geom1_id,
'geos' if topo_equal_check else 'wkt',
precision,
geom0.constGet().asWkt(precision) if not geom0.isNull() else 'NULL',
geom1.constGet().asWkt(precision) if not geom1.isNull() else 'NULL'
geom1.constGet().asWkt(precision) if not geom1.isNull() else 'NULL',
geom0.constGet().asWkt() if not geom1.isNull() else 'NULL',
geom1.constGet().asWkt() if not geom0.isNull() else 'NULL'
)
)
else:

0 comments on commit 7d1ca81

Please sign in to comment.
You can’t perform that action at this time.