From add9cd35c889a97ed01f39cc52aeb3f25e9b87ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 5 Sep 2026 01:45:25 +0000 Subject: [PATCH] grass.pygrass: Mark test_raster_region resampling tests xfail on Windows Follow-up to #7902: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak reproducible here: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix that can't be verified; needs investigation with actual Windows access. --- .../pygrass/raster/testsuite/test_raster_region.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/grass/pygrass/raster/testsuite/test_raster_region.py b/python/grass/pygrass/raster/testsuite/test_raster_region.py index 3c4e28e3289..f9e5819d8b9 100644 --- a/python/grass/pygrass/raster/testsuite/test_raster_region.py +++ b/python/grass/pygrass/raster/testsuite/test_raster_region.py @@ -1,5 +1,6 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test +from grass.gunittest.utils import xfail_windows from grass.pygrass.raster import RasterRow from grass.pygrass.raster import raster2numpy @@ -26,6 +27,13 @@ def tearDownClass(cls): cls.runModule("g.remove", flags="f", type="raster", name=cls.name) cls.del_temp_region() + # Windows-only: the small region set below isn't actually restricting + # what RasterRow reads back (rast[0] comes back with ~100000 elements + # instead of 10). Confirmed this is specific to Windows: passes reliably + # on Linux both in isolation and as part of the full testsuite run (so + # it isn't a state leak from an earlier test file either). Needs + # investigation with actual Windows access; remove once fixed. + @xfail_windows def test_resampling_1(self): region = Region() @@ -47,6 +55,7 @@ def test_resampling_1(self): rast[5].tolist(), [23, 23, 23, 23, 23, 33, 33, 33, 33, 33] ) + @xfail_windows # same Windows-only issue as test_resampling_1 def test_resampling_2(self): region = Region() @@ -73,6 +82,7 @@ def test_resampling_2(self): self.assertCountEqual(rast[2].tolist()[2:6], [11.0, 21.0, 31.0, 41.0]) self.assertCountEqual(rast[5].tolist()[2:6], [14.0, 24.0, 34.0, 44.0]) + @xfail_windows # same Windows-only issue as test_resampling_1 def test_resampling_to_numpy(self): region = Region() region.ewres = 0.1