Skip to content

Commit

Permalink
Removing the escape sequence from the output!
Browse files Browse the repository at this point in the history
Testcases fail as the output is having escape
sequence in it which is not expected to be there.
Removing this escape sequence fixes almost 2000+ testcases.
Signed-off-by: Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
  • Loading branch information
Anushree-Mathur committed Jan 3, 2025
1 parent 72d2e67 commit 8c06d22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aexpect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,9 @@ def read_until_last_line_matches(self, patterns, timeout=60.0,
def _get_last_nonempty_line(cont):
nonempty_lines = [_ for _ in cont.splitlines() if _.strip()]
if nonempty_lines:
return nonempty_lines[-1]
# Removing escape sequence from the last element of nonempty_lines
nonempty_last_no_escape = astring.strip_console_codes(nonempty_lines[-1])
return nonempty_last_no_escape
return ""

return self.read_until_output_matches(patterns,
Expand Down

0 comments on commit 8c06d22

Please sign in to comment.