Add more powerful set assertion rewrites for comparisons other than equality ==
(eg: <=
, etc.)
#10617
Labels
topic: rewrite
related to the assertion rewrite mechanism
type: enhancement
new feature or API change, should be merged into features branch
What's the problem this feature will solve?
Set comparisons that do not check for pure equality do not have nice assertion rewriting.
Examples:
Describe the solution you'd like
When asserting sets are unequal, such as
set_a <= set_b
, the assertion text should be more intelligent only displaying the values that fail the check.This might look like:
Alternative Solutions
I'm not aware of any plugins or other tools that implement this, but I have creating my own using
pytest_assertrepr_compare
:We then get the following:
Additional context
The text was updated successfully, but these errors were encountered: