Skip to content

Commit

Permalink
TST: fix hypothesis test failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mferrera committed Oct 25, 2023
1 parent f382764 commit 133ced9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_grid3d/gridprop_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 133ced9

Please sign in to comment.