Skip to content

Commit 6d95d00

Browse files
prasad-sawantdesaiolivhoenen
authored andcommitted
timestamp converted to supported format for Python 3.8
1 parent 430391d commit 6d95d00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

imas/test/test_ids_convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def test_provenance_entry(factory):
200200
timestamp = str(cp4.ids_properties.provenance.node[0].reference[0].timestamp)
201201
# Check that timestamp adheres to the format YYYY-MM-DDTHH:MM:SSZ
202202
assert re.match(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z", timestamp)
203-
dtime = datetime.now(UTC) - datetime.fromisoformat(timestamp)
203+
timestamp_for_parsing = timestamp.replace("Z", "+00:00")
204+
dtime = datetime.now(UTC) - datetime.fromisoformat(timestamp_for_parsing)
204205
assert timedelta(seconds=0) <= dtime < timedelta(seconds=2)
205206

206207

0 commit comments

Comments
 (0)