Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkaklarck committed Feb 5, 2025
1 parent 498b8bd commit 99c8417
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions robotstatuschecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ def _split_status_and_logs(self, doc: str) -> "tuple[str, str]":
if "LOG" not in doc:
return doc, ""
log_index = doc.find("LOG")
status_indices = [doc.find(status) for status in ("FAIL", "SKIP", "PASS")
if status in doc]
status_indices = [
doc.find(status) for status in ("FAIL", "SKIP", "PASS") if status in doc
]
if not status_indices or log_index < min(status_indices):
return "", doc
return doc[:log_index], doc[log_index:]
Expand Down Expand Up @@ -165,7 +166,7 @@ def _message_matches(self, actual: str, expected: str) -> bool:
if actual == expected:
return True
if expected.startswith("REGEXP:"):
pattern = expected.replace('REGEXP:', '', 1).strip()
pattern = expected.replace("REGEXP:", "", 1).strip()
if re.fullmatch(pattern, actual, re.DOTALL):
return True
if expected.startswith("GLOB:"):
Expand Down

0 comments on commit 99c8417

Please sign in to comment.