-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Help with plugin assertion rewriting #5931
Copy link
Copy link
Closed
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Metadata
Metadata
Assignees
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hey, I was looking at the pytest-clarity package and it does something really nice, imo, which is it turns this:
into:
The downside is that the rewriting results in a loss of functionality:
Goes from
to
I've been digging through the source and I can't quite find the right part to use to do this. It stems from use of
pytest_assertrepr_comparebut I can't find anything in pytest I can use to construct that3 = len([1, 2, 3]). I'm looking for some pointers if anyone can help put me on the right track. I was barking down theAssertionRewriterwhich I think is what I'm looking for but I can't quite put my finger on how to modify these assertions in way that still utilizes that code.