From 4cd82983214cbb951c0f082692e287383e356ba7 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 20 Dec 2024 07:55:10 +1000 Subject: [PATCH] Make test more robust across different geos/proj versions --- .../python/test_qgsvectorlayerprofilegenerator.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/src/python/test_qgsvectorlayerprofilegenerator.py b/tests/src/python/test_qgsvectorlayerprofilegenerator.py index 4f1320c506cf..89bf08803f71 100644 --- a/tests/src/python/test_qgsvectorlayerprofilegenerator.py +++ b/tests/src/python/test_qgsvectorlayerprofilegenerator.py @@ -3366,13 +3366,12 @@ def testVerticalLineGenerationFeatureTolerance(self): result = results[0] self.assertEqual(result.wkbType(), Qgis.WkbType.LineStringZ) - if Qgis.geosVersionMajor() == 3 and Qgis.geosVersionMinor() == 12: - expected_wkt = "LineStringZ (-347055.8 6632478.8 1, -347055.8 6632478.8 -22, -347055.8 6632478.8 1)" - else: - expected_wkt = "LineStringZ (-347054.8 6632479.6 1, -347054.8 6632479.6 -22, -347054.8 6632479.6 1)" - self.assertTrue( - compareWkt(expected_wkt, result.asWkt(), 0.1), - f"Expected: {expected_wkt}\nGot: {result.asWkt()}\n", + self.assertIn( + result.asWkt(1), + ( + "LineString Z (-347055.8 6632478.8 1, -347055.8 6632478.8 -22, -347055.8 6632478.8 1)", + "LineString Z (-347054.8 6632479.6 1, -347054.8 6632479.6 -22, -347054.8 6632479.6 1)", + ), ) def test_vertical_transformation_4978_to_4985(self):