Skip to content

Commit

Permalink
add microsecond to test_parse_iso8601_like
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Dec 14, 2024
1 parent 8aa8e51 commit eb918cc
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions xarray/tests/test_cftimeindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,23 @@
standard_or_gregorian = "standard"


def date_dict(year=None, month=None, day=None, hour=None, minute=None, second=None):
def date_dict(
year=None,
month=None,
day=None,
hour=None,
minute=None,
second=None,
microsecond=None,
):
return dict(
year=year, month=month, day=day, hour=hour, minute=minute, second=second
year=year,
month=month,
day=day,
hour=hour,
minute=minute,
second=second,
microsecond=microsecond,
)


Expand Down Expand Up @@ -100,7 +114,9 @@ def test_parse_iso8601_like(string, expected):

with pytest.raises(ValueError):
parse_iso8601_like(string + "3")
parse_iso8601_like(string + ".3")
if result["second"] is None:
with pytest.raises(ValueError):
parse_iso8601_like(string + ".3")


_CFTIME_CALENDARS = [
Expand Down

0 comments on commit eb918cc

Please sign in to comment.