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

Method do_check_both

Lib/test/test_statistics.py:562–568  ·  view source on GitHub ↗
(self, a, b, tol, rel, tol_flag, rel_flag)

Source from the content-addressed store, hash-verified

560 # 4) actual error > both absolute and relative error
561
562 def do_check_both(self, a, b, tol, rel, tol_flag, rel_flag):
563 check = self.assertTrue if tol_flag else self.assertFalse
564 check(approx_equal(a, b, tol=tol, rel=0))
565 check = self.assertTrue if rel_flag else self.assertFalse
566 check(approx_equal(a, b, tol=0, rel=rel))
567 check = self.assertTrue if (tol_flag or rel_flag) else self.assertFalse
568 check(approx_equal(a, b, tol=tol, rel=rel))
569
570 def test_approx_equal_both1(self):
571 # Test actual error <= both absolute and relative error.

Callers 4

Calls 2

approx_equalFunction · 0.85
checkFunction · 0.70

Tested by

no test coverage detected