WIP: Truncate objects the same way we truncate other messages#12322
WIP: Truncate objects the same way we truncate other messages#12322ssbarnea wants to merge 1 commit into
Conversation
nicoddemus
left a comment
There was a problem hiding this comment.
Hi @ssbarnea, thanks for the PR!
Btw sorry about the frustration this seems to be causing, I intended to tackle this when I had the time, but free time has eluded me in the past week.
About the solution, while it would work, seems we already consider verbosity when deciding the max size used by saferepr here:
pytest/src/_pytest/assertion/rewrite.py
Lines 428 to 438 in 93dd34e
So ideally we should just use that function in order to honor that. Seems to me it could be a matter of just replacing saferepr by _saferepr here:
pytest/src/_pytest/assertion/rewrite.py
Line 454 in 93dd34e
If that works, I think we can even consider this a bug fix, as it seems this should be using _saferepr all along, being an oversight.
|
@nicoddemus Apparently that change does not fix it and now we have a separate bug report for this problem. I tried to find the root cause but run out of time for today. I will first add a reproducing test for as we clearly do not want this to regress in the future. |
|
Thanks @ssbarnea! |
Fixes: #12307
Related: #6682