MCPcopy Index your code
hub / github.com/python/cpython / _make_std_err_msg

Method _make_std_err_msg

Lib/test/test_statistics.py:282–296  ·  view source on GitHub ↗
(first, second, tol, rel, idx)

Source from the content-addressed store, hash-verified

280
281 @staticmethod
282 def _make_std_err_msg(first, second, tol, rel, idx):
283 # Create the standard error message for approx_equal failures.
284 assert first != second
285 template = (
286 ' %r != %r\n'
287 ' values differ by more than tol=%r and rel=%r\n'
288 ' -> absolute error = %r\n'
289 ' -> relative error = %r'
290 )
291 if idx is not None:
292 header = 'numeric sequences first differ at index %d.\n' % idx
293 template = header + template
294 # Calculate actual errors:
295 abs_err, rel_err = _calc_errors(first, second)
296 return template % (first, second, tol, rel, abs_err, rel_err)
297
298
299# ========================

Callers 2

_check_approx_numMethod · 0.95
do_testMethod · 0.80

Calls 1

_calc_errorsFunction · 0.85

Tested by

no test coverage detected