MCPcopy
hub / github.com/quantopian/zipline / assert_equal

Function assert_equal

zipline/testing/predicates.py:375–395  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

373
374@dispatch(object, object)
375def 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)

Calls 1