Skip to content

Commit

Permalink
TST: Solve compatibility with pytest 7.1
Browse files Browse the repository at this point in the history
pytest.approx no longer wants to work with unordered sequences
  • Loading branch information
berland authored and oyvindeide committed Mar 14, 2022
1 parent b5ff572 commit 0bed984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/test_surface/test_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def test_read_cube(data):
}
cube = Cube(**cube_input)
surf_from_cube = RegularSurface._read_cube(cube, data)
assert set(surf_from_cube.values.data.flatten().tolist()) == pytest.approx({data})
assert list(set(surf_from_cube.values.data.flatten().tolist())) == pytest.approx(
[data]
)

cube_input.pop("zinc")
cube_input.pop("nlay")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_surface/test_new_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_wrong_size_input_lists(data):
@given(data=st.one_of(st.floats(allow_nan=False), st.integers()))
def test_input_numbers(data):
surf = RegularSurface(10, 10, 0.0, 0.0, values=data)
assert set(surf.values.data.flatten().tolist()) == pytest.approx({data})
assert list(set(surf.values.data.flatten().tolist())) == pytest.approx([data])


def test_read_grid3d():
Expand Down

0 comments on commit 0bed984

Please sign in to comment.