|
9 | 9 | from typing import Mapping
|
10 | 10 | from typing import Optional
|
11 | 11 | from typing import Sequence
|
12 |
| -from typing import Tuple |
13 | 12 |
|
14 | 13 | import _pytest._code
|
15 | 14 | from _pytest import outcomes
|
@@ -179,8 +178,7 @@ def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]:
|
179 | 178 | elif isdict(left) and isdict(right):
|
180 | 179 | explanation = _compare_eq_dict(left, right, verbose)
|
181 | 180 | elif type(left) == type(right) and (isdatacls(left) or isattrs(left)):
|
182 |
| - type_fn = (isdatacls, isattrs) |
183 |
| - explanation = _compare_eq_cls(left, right, verbose, type_fn) |
| 181 | + explanation = _compare_eq_cls(left, right, verbose) |
184 | 182 | elif verbose > 0:
|
185 | 183 | explanation = _compare_eq_verbose(left, right)
|
186 | 184 | if isiterable(left) and isiterable(right):
|
@@ -403,13 +401,7 @@ def _compare_eq_dict(
|
403 | 401 | return explanation
|
404 | 402 |
|
405 | 403 |
|
406 |
| -def _compare_eq_cls( |
407 |
| - left: Any, |
408 |
| - right: Any, |
409 |
| - verbose: int, |
410 |
| - type_fns: Tuple[Callable[[Any], bool], Callable[[Any], bool]], |
411 |
| -) -> List[str]: |
412 |
| - isdatacls, isattrs = type_fns |
| 404 | +def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: |
413 | 405 | if isdatacls(left):
|
414 | 406 | all_fields = left.__dataclass_fields__
|
415 | 407 | fields_to_check = [field for field, info in all_fields.items() if info.compare]
|
|
0 commit comments