Resolved merge issues

This commit is contained in:
HomieOmie 2023-05-06 18:27:52 -04:00
parent 5f86e6f506
commit ac3cb751a3
2 changed files with 21 additions and 7 deletions

View File

@ -1158,6 +1158,10 @@ class ReprEntry(TerminalRepr):
if is_failure_line:
# from this point on all lines are considered part of the failure
failure_lines.extend(self.lines[index:])
for line in self.lines[index:]:
print(line)
break
else:
if self.style == "value":
@ -1180,6 +1184,8 @@ class ReprEntry(TerminalRepr):
for line in failure_lines:
line_list = line.split()
# multiline case seems to be an issue with just an added ','
# print(line_list)
# These are edge cases for empty lists
if len(line_list) == 3 and line_list[2] == "," and line_list[1] == "-":
line = line.replace(",", "[]")
# This is to remove the extra whitespace between '-' and '[]'
@ -1187,6 +1193,14 @@ class ReprEntry(TerminalRepr):
extra_wp_i = line_list.index("-") + 1
line_list.pop(extra_wp_i)
line = "".join(line_list)
elif len(line_list) == 3 and line_list[2] == "," and line_list[1] == "+":
line = line.replace(",", "[]")
# This is to remove the extra whitespace between '+' and '[]'
line_list = list(line)
extra_wp_i = line_list.index("+") + 1
line_list.pop(extra_wp_i)
line = "".join(line_list)
# print(line)
tw.line(line, bold=True, red=True)
def toterminal(self, tw: TerminalWriter) -> None:

View File

@ -10,13 +10,13 @@ def test2_():
m = [
"This is another check"
" This line and the line above should be fine"
" Same with this line"
" But we should not see the '- ,' appear"
" But rather we should see a '- []' appear"
"Same with this line"
"But we should not see the '- ,' appear"
"But rather we should see a '- []' appear"
]
assert m == []
assert [] == m
def test3_():
m = ["This is some dummy test which shows the strange way in which Pycharm"]
assert m == []
# def test3_():
# m = ["This is some dummy test which shows the strange way in which Pycharm"]
# assert m == []