Skip to content

Commit f0855ea

Browse files
committed
fix tests
1 parent f55e2fb commit f0855ea

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tests/v4/test_fieldset.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from contextlib import nullcontext
21
from datetime import timedelta
32

43
import cftime
@@ -107,8 +106,7 @@ def test_fieldset_init_incompatible_calendars():
107106
grid2 = Grid(ds2)
108107
incompatible_calendar = Field("test", ds2["data_g"], grid2, mesh_type="flat")
109108

110-
# with pytest.raises(CalendarError, match="Expected field 'test' to have calendar compatible with datetime object"):
111-
with nullcontext():
109+
with pytest.raises(CalendarError, match="Expected field '.*' to have calendar compatible with datetime object"):
112110
FieldSet([U, V, UV, incompatible_calendar])
113111

114112

@@ -118,7 +116,7 @@ def test_fieldset_add_field_incompatible_calendars(fieldset):
118116
grid = Grid(ds_test)
119117
field = Field("test_field", ds_test["data_g"], grid, mesh_type="flat")
120118

121-
with pytest.raises(CalendarError, match="Expected field 'test' to have calendar compatible with datetime object"):
119+
with pytest.raises(CalendarError, match="Expected field '.*' to have calendar compatible with datetime object"):
122120
fieldset.add_field(field, "test_field")
123121

124122

0 commit comments

Comments
 (0)