Create an assertion error formatted for use in ``assert_equal``. Parameters ---------- assertion_message : str The concrete reason for the failure. path : tuple[str] The path leading up to the failure. msg : str The user supplied message. Returns
(assertion_message, path, msg)
| 342 | |
| 343 | |
| 344 | def make_assert_equal_assertion_error(assertion_message, path, msg): |
| 345 | """Create an assertion error formatted for use in ``assert_equal``. |
| 346 | |
| 347 | Parameters |
| 348 | ---------- |
| 349 | assertion_message : str |
| 350 | The concrete reason for the failure. |
| 351 | path : tuple[str] |
| 352 | The path leading up to the failure. |
| 353 | msg : str |
| 354 | The user supplied message. |
| 355 | |
| 356 | Returns |
| 357 | ------- |
| 358 | exception_instance : AssertionError |
| 359 | The new exception instance. |
| 360 | |
| 361 | Notes |
| 362 | ----- |
| 363 | This doesn't raise the exception, it only returns it. |
| 364 | """ |
| 365 | return AssertionError( |
| 366 | '%s%s\n%s' % ( |
| 367 | _fmt_msg(msg), |
| 368 | assertion_message, |
| 369 | _fmt_path(path), |
| 370 | ), |
| 371 | ) |
| 372 | |
| 373 | |
| 374 | @dispatch(object, object) |
no test coverage detected