Skip to content

Commit b6ec61a

Browse files
pjonssonomad
authored andcommitted
tests: fix type signature
1 parent 72c22d9 commit b6ec61a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

integration_tests/test_eo3_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def test_undo_eo3_compatibility_del_handling() -> None:
219219
assert "extent" not in doc
220220

221221

222-
def with_parsed_datetimes(v: dict, name=""):
222+
def with_parsed_datetimes(v: dict | str | datetime | list, name=""):
223223
"""
224224
All date fields in eo3 metadata have names ending in 'datetime'. Return a doc
225225
with all of these fields parsed as actual dates.
@@ -229,7 +229,7 @@ def with_parsed_datetimes(v: dict, name=""):
229229
if not v:
230230
return v
231231

232-
if name.endswith("datetime"):
232+
if name.endswith("datetime") and isinstance(v, str | datetime):
233233
dt = parse_time(v)
234234
# Strip/normalise timezone to match default yaml.load()
235235
if dt.tzinfo:

0 commit comments

Comments
 (0)