Assert that two objects are equal using the ``==`` operator. Parameters ---------- result : object The result that came from the function under test. expected : object The expected result. Raises ------ AssertionError Raised when ``result`` is no
(result, expected, path=(), msg='', **kwargs)
| 373 | |
| 374 | @dispatch(object, object) |
| 375 | def assert_equal(result, expected, path=(), msg='', **kwargs): |
| 376 | """Assert that two objects are equal using the ``==`` operator. |
| 377 | |
| 378 | Parameters |
| 379 | ---------- |
| 380 | result : object |
| 381 | The result that came from the function under test. |
| 382 | expected : object |
| 383 | The expected result. |
| 384 | |
| 385 | Raises |
| 386 | ------ |
| 387 | AssertionError |
| 388 | Raised when ``result`` is not equal to ``expected``. |
| 389 | """ |
| 390 | if result != expected: |
| 391 | raise make_assert_equal_assertion_error( |
| 392 | '%s != %s' % (result, expected), |
| 393 | path, |
| 394 | msg, |
| 395 | ) |
| 396 | |
| 397 | |
| 398 | @assert_equal.register(float, float) |