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

Method generate_substrings

Lib/test/test_statistics.py:660–671  ·  view source on GitHub ↗

Return substrings we expect to see in error messages.

(self, first, second, tol, rel, idx)

Source from the content-addressed store, hash-verified

658 self.do_test(args)
659
660 def generate_substrings(self, first, second, tol, rel, idx):
661 """Return substrings we expect to see in error messages."""
662 abs_err, rel_err = _calc_errors(first, second)
663 substrings = [
664 'tol=%r' % tol,
665 'rel=%r' % rel,
666 'absolute error = %r' % abs_err,
667 'relative error = %r' % rel_err,
668 ]
669 if idx is not None:
670 substrings.append('differ at index %d' % idx)
671 return substrings
672
673
674# =======================================

Callers 1

do_testMethod · 0.95

Calls 2

_calc_errorsFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected