Skip to content

Commit 124d9cc

Browse files
use datetime.fromisoformat instead of strptime
1 parent 8e13266 commit 124d9cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

testing/test_junitxml.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ def test_pass():
236236
start_time = datetime.now(timezone.utc)
237237
result, dom = run_and_parse(family=xunit_family)
238238
node = dom.get_first_by_tag("testsuite")
239-
timestamp = datetime.strptime(node["timestamp"], "%Y-%m-%dT%H:%M:%S.%f")
240-
assert start_time <= timestamp < datetime.now()
239+
print(node["timestamp"])
240+
timestamp = datetime.fromisoformat(node["timestamp"])
241+
assert start_time <= timestamp < datetime.now(timezone.utc)
241242

242243
def test_timing_function(
243244
self,

0 commit comments

Comments
 (0)