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

Function test_binary

Modules/_decimal/tests/deccheck.py:988–1011  ·  view source on GitHub ↗

Iterate a binary function through many test cases.

(method, prec, exp_range, restricted_range, itr, stat)

Source from the content-addressed store, hash-verified

986 log(err)
987
988def test_binary(method, prec, exp_range, restricted_range, itr, stat):
989 """Iterate a binary function through many test cases."""
990 if method in BinaryRestricted:
991 exp_range = restricted_range
992 for op in all_binary(prec, exp_range, itr):
993 t = TestSet(method, op)
994 try:
995 if not convert(t):
996 continue
997 callfuncs(t)
998 verify(t, stat)
999 except VerifyError as err:
1000 log(err)
1001
1002 if not method.startswith('__'):
1003 for op in binary_optarg(prec, exp_range, itr):
1004 t = TestSet(method, op)
1005 try:
1006 if not convert(t):
1007 continue
1008 callfuncs(t)
1009 verify(t, stat)
1010 except VerifyError as err:
1011 log(err)
1012
1013def test_ternary(method, prec, exp_range, restricted_range, itr, stat):
1014 """Iterate a ternary function through many test cases."""

Callers

nothing calls this directly

Calls 8

all_binaryFunction · 0.90
binary_optargFunction · 0.90
callfuncsFunction · 0.85
TestSetClass · 0.70
convertFunction · 0.70
verifyFunction · 0.70
logFunction · 0.70
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…