Skip to content

Commit

Permalink
Calculate stop_date only when start_date is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkaye authored and atodorov committed Dec 10, 2023
1 parent c9c1a6b commit edc3f1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcms_junit_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def testexecution_timestamps(self, xml_suite, xml_case):
# update start_date if individual case contains this information
if "timestamp" in xml_case._elem.attrib:
start_date = self.parse_timestamp(xml_case._elem.attrib["timestamp"])
if "time" in xml_case._elem.attrib:
if start_date and "time" in xml_case._elem.attrib:
stop_date = start_date + timedelta(seconds=xml_case.time)

return (start_date, stop_date)
Expand Down

0 comments on commit edc3f1d

Please sign in to comment.