Skip to content

Commit

Permalink
assert_are_codes_equal: better format errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Nov 15, 2024
1 parent 613367d commit 929e086
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/codemanip/code_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,20 @@ def assert_are_equal_ignore_spaces(generated_code: Any, expected_code: str) -> N
diff_str = make_nice_code_diff(generated_processed, expected_processed)
logging.error(
f"""assert_are_equal_ignore_spaces returns false
========================
with diff=
========================
{str(diff_str)}
========================
expected_processed=
========================
{expected_processed}
========================
and generated_processed=
========================
{generated_processed}
"""
)
Expand All @@ -592,11 +601,19 @@ def assert_are_codes_equal(generated_code: Any, expected_code: str) -> None:
diff_str = make_nice_code_diff(generated_processed, expected_processed)
logging.error(
f"""assert_are_codes_equal returns false
========================
with diff=
========================
{str(diff_str)}
========================
expected_processed=
========================
{expected_processed}
========================
and generated_processed=
========================
{generated_processed}
"""
)
Expand Down

0 comments on commit 929e086

Please sign in to comment.