|
20 | 20 | from _pytest._io.saferepr import saferepr
|
21 | 21 | from _pytest._io.saferepr import saferepr_unlimited
|
22 | 22 | from _pytest.assertion._compare_set import _compare_eq_set
|
23 |
| -from _pytest.assertion._compare_set import _compare_gt_set |
24 |
| -from _pytest.assertion._compare_set import _compare_gte_set |
25 |
| -from _pytest.assertion._compare_set import _compare_lt_set |
26 |
| -from _pytest.assertion._compare_set import _compare_lte_set |
27 |
| -from _pytest.assertion._compare_set import SetComparisonFunction |
| 23 | +from _pytest.assertion._compare_set import SET_COMPARISON_FUNCTIONS |
28 | 24 | from _pytest.assertion._typing import _HighlightFunc
|
29 | 25 | from _pytest.config import Config
|
30 | 26 |
|
@@ -216,14 +212,9 @@ def assertrepr_compare(
|
216 | 212 | "!=" | ">=" | "<=" | ">" | "<",
|
217 | 213 | set() | frozenset(),
|
218 | 214 | ):
|
219 |
| - set_compare_func: SetComparisonFunction = { |
220 |
| - "!=": lambda *a, **kw: ["Both sets are equal"], |
221 |
| - ">=": _compare_gte_set, |
222 |
| - "<=": _compare_lte_set, |
223 |
| - ">": _compare_gt_set, |
224 |
| - "<": _compare_lt_set, |
225 |
| - } |
226 |
| - explanation = set_compare_func[op](left, right, highlighter, verbose) |
| 215 | + explanation = SET_COMPARISON_FUNCTIONS[op]( |
| 216 | + left, right, highlighter, verbose |
| 217 | + ) |
227 | 218 | case _:
|
228 | 219 | explanation = None
|
229 | 220 | except outcomes.Exit:
|
|
0 commit comments