Skip to content

Commit

Permalink
Call correct _saferepr() in _format_assertmsg
Browse files Browse the repository at this point in the history
Fixes: #6682
  • Loading branch information
ssbarnea committed May 14, 2024
1 parent 93dd34e commit 66a18f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/assertion/rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def _format_assertmsg(obj: object) -> str:
# However in either case we want to preserve the newline.
replaces = [("\n", "\n~"), ("%", "%%")]
if not isinstance(obj, str):
obj = saferepr(obj)
obj = _saferepr(obj)
replaces.append(("\\n", "\n~"))

for r1, r2 in replaces:
Expand Down

0 comments on commit 66a18f7

Please sign in to comment.