Revised formatting to work with multiple implicitly concatenated strings

This commit is contained in:
JamieC2002 2023-12-07 19:46:12 -05:00
commit f8f8e544b7
3 changed files with 27 additions and 0 deletions

View File

@ -180,6 +180,7 @@ Jake VanderPlas
Jakob van Santen Jakob van Santen
Jakub Mitoraj Jakub Mitoraj
James Bourbeau James Bourbeau
Jamie Chen
Jan Balster Jan Balster
Janne Vanhala Janne Vanhala
Jason R. Coombs Jason R. Coombs
@ -205,6 +206,7 @@ Justice Ndou
Justyna Janczyszyn Justyna Janczyszyn
Kale Kundert Kale Kundert
Kamran Ahmad Kamran Ahmad
Kaylin Yeoh
Kenny Y Kenny Y
Karl O. Pinc Karl O. Pinc
Karthikeyan Singaravelan Karthikeyan Singaravelan

View File

@ -0,0 +1,4 @@
Found source causes multiline string diff error
Added private functions to check specific cases
Fixed output issue with implicit concatonated strings
Added tests in test assertion file in function test_multiline_diff

View File

@ -395,6 +395,27 @@ class TestAssert_reprcompare:
"- eggs", "- eggs",
"+ spam", "+ spam",
] ]
def test_multiline_diff(self) -> None:
m = [
"This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff."
]
assert callequal(m, []) == [
"['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(m, [], 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 "
"displays the full diff.']",
]
def test_text_skipping(self) -> None: def test_text_skipping(self) -> None:
lines = callequal("a" * 50 + "spam", "a" * 50 + "eggs") lines = callequal("a" * 50 + "spam", "a" * 50 + "eggs")