Return substrings we expect to see in error messages.
(self, first, second, tol, rel, idx)
| 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 | # ======================================= |
no test coverage detected