From e2e9f7d12c555cac7c627758188e52ae447568c1 Mon Sep 17 00:00:00 2001 From: Maddie Thai-Tang Date: Wed, 3 May 2023 10:40:05 -0400 Subject: [PATCH] passing new test, need to fix other tests --- src/_pytest/assertion/util.py | 3 +++ testing/test_error_diffs.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 5a7b06a6a..672d858a2 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -290,7 +290,10 @@ def _diff_text(left: str, right: str, verbose: int = 0) -> List[str]: for line in ndiff(right.splitlines(keepends), left.splitlines(keepends)) ] for i in range(len(explanation)): + explanation[i] = explanation[i].replace("+ ", "+ \t") explanation[i] = explanation[i].replace(" ", "\t") + print("**********************LOOK HERE***********************") + print(explanation) return explanation diff --git a/testing/test_error_diffs.py b/testing/test_error_diffs.py index c879a707c..a12aac342 100644 --- a/testing/test_error_diffs.py +++ b/testing/test_error_diffs.py @@ -272,10 +272,10 @@ TESTCASES = [ """, """ > assert result == desired - E AssertionError: assert 'spam\\tbacon\\n\\teggs love' == 'spam bacon eggs love' + E AssertionError: assert 'spam bacon\\n eggs love' == 'spam bacon eggs love' E - spam bacon eggs love - E + spam bacon - E + eggs love + E + spam\tbacon + E + \teggs love """, id='Test "not in" string', ),