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

Function make_assert_equal_assertion_error

zipline/testing/predicates.py:344–371  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

342
343
344def 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)

Callers 1

assert_equalFunction · 0.85

Calls 2

_fmt_msgFunction · 0.85
_fmt_pathFunction · 0.85

Tested by

no test coverage detected