Re-added _surrounding_parens_on_own_lines(), and fixed test cases related to issue #10863 to account for new changes from main
This commit is contained in:
parent
1741952b49
commit
7459535127
|
@ -359,6 +359,18 @@ def _compare_eq_iterable(
|
|||
return explanation
|
||||
|
||||
|
||||
def _surrounding_parens_on_own_lines(lines: List[str]) -> None:
|
||||
"""Move opening/closing parenthesis/bracket to own lines."""
|
||||
opening = lines[0][:1]
|
||||
if opening in ["(", "[", "{"]:
|
||||
lines[0] = " " + lines[0][1:]
|
||||
lines[:] = [opening] + lines
|
||||
closing = lines[-1][-1:]
|
||||
if closing in [")", "]", "}"]:
|
||||
lines[-1] = lines[-1][:-1] + ","
|
||||
lines[:] = lines + [closing]
|
||||
|
||||
|
||||
def _is_empty_vs_non_empty(left: Iterable[Any], right: Iterable[Any]) -> bool:
|
||||
is_left_empty = not any(left) if isinstance(left, Iterable) else not left
|
||||
is_right_empty = not any(right) if isinstance(right, Iterable) else not right
|
||||
|
|
|
@ -416,14 +416,17 @@ class TestAssert_reprcompare:
|
|||
|
||||
assert callequal(m1, []) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains one more item: 'This is some dummy test which shows the "
|
||||
"strange way in which Pycharm displays the full diff.'",
|
||||
"Use -v to get more diff",
|
||||
]
|
||||
assert callequal(m1, [], verbose=True) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains one more item: 'This is some dummy test which shows the "
|
||||
"strange way in which Pycharm displays the full diff.'",
|
||||
"",
|
||||
"Full diff:",
|
||||
"- []",
|
||||
"+ ['This is some dummy test which shows the strange way in which Pycharm "
|
||||
|
@ -432,6 +435,7 @@ class TestAssert_reprcompare:
|
|||
|
||||
assert callequal(m2, []) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains one more item: 'This is some dummy test which shows the "
|
||||
"strange way in which Pycharm displays the full diff.This is some dummy test "
|
||||
"which shows the strange way in which Pycharm displays the full diff.'",
|
||||
|
@ -440,9 +444,11 @@ class TestAssert_reprcompare:
|
|||
|
||||
assert callequal(m2, [], verbose=True) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains one more item: 'This is some dummy test which shows the "
|
||||
"strange way in which Pycharm displays the full diff.This is some dummy test "
|
||||
"which shows the strange way in which Pycharm displays the full diff.'",
|
||||
"" "",
|
||||
"Full diff:",
|
||||
"- []",
|
||||
"+ ['This is some dummy test which shows the strange way in which Pycharm "
|
||||
|
@ -452,15 +458,18 @@ class TestAssert_reprcompare:
|
|||
|
||||
assert callequal(m3, []) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains 2 more items, first extra item: 'This is some dummy test which shows the strange way in "
|
||||
"which Pycharm displays the full diff.'",
|
||||
"Use -v to get more diff",
|
||||
"" "Use -v to get more diff",
|
||||
]
|
||||
|
||||
assert callequal(m3, [], verbose=True) == [
|
||||
"['This is som...e full diff.'] == []",
|
||||
"",
|
||||
"Left contains 2 more items, first extra item: 'This is some dummy test which shows the strange way in "
|
||||
"which Pycharm displays the full diff.'",
|
||||
"",
|
||||
"Full diff:",
|
||||
" [",
|
||||
"- ,",
|
||||
|
|
Loading…
Reference in New Issue