From 133ced93d30ce6b8ef5faa8de907990596562924 Mon Sep 17 00:00:00 2001 From: mferrera Date: Wed, 25 Oct 2023 12:51:22 +0200 Subject: [PATCH] TST: fix hypothesis test failure After the hypothesis profile change a test that generates a GridProperty started to fail reliably. It seems like it might be timing related: drawing the name value outside of the GridProperty instantiation seems to fix it. --- tests/test_grid3d/gridprop_generator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_grid3d/gridprop_generator.py b/tests/test_grid3d/gridprop_generator.py index ac312d6ab..3d4a53199 100644 --- a/tests/test_grid3d/gridprop_generator.py +++ b/tests/test_grid3d/gridprop_generator.py @@ -18,6 +18,7 @@ def grid_properties(draw, name=keywords, grid=xtgeo_grids): grid = draw(grid) dims = grid.dimensions is_discrete = draw(st.booleans()) + _name = draw(name) if is_discrete: num_codes = draw(st.integers(min_value=2, max_value=10)) code_names = draw( @@ -41,7 +42,7 @@ def grid_properties(draw, name=keywords, grid=xtgeo_grids): gp = GridProperty( grid, *dims, - draw(name), + _name, discrete=is_discrete, codes=dict(zip(code_values, code_names)), values=values, @@ -55,7 +56,7 @@ def grid_properties(draw, name=keywords, grid=xtgeo_grids): return GridProperty( grid, *dims, - draw(name), + _name, discrete=is_discrete, values=values, grid=grid,