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

Function test_ternary

Modules/_decimal/tests/deccheck.py:1013–1036  ·  view source on GitHub ↗

Iterate a ternary function through many test cases.

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

Source from the content-addressed store, hash-verified

1011 log(err)
1012
1013def test_ternary(method, prec, exp_range, restricted_range, itr, stat):
1014 """Iterate a ternary function through many test cases."""
1015 if method in TernaryRestricted:
1016 exp_range = restricted_range
1017 for op in all_ternary(prec, exp_range, itr):
1018 t = TestSet(method, op)
1019 try:
1020 if not convert(t):
1021 continue
1022 callfuncs(t)
1023 verify(t, stat)
1024 except VerifyError as err:
1025 log(err)
1026
1027 if not method.startswith('__'):
1028 for op in ternary_optarg(prec, exp_range, itr):
1029 t = TestSet(method, op)
1030 try:
1031 if not convert(t):
1032 continue
1033 callfuncs(t)
1034 verify(t, stat)
1035 except VerifyError as err:
1036 log(err)
1037
1038def test_format(method, prec, exp_range, restricted_range, itr, stat):
1039 """Iterate the __format__ method through many test cases."""

Callers

nothing calls this directly

Calls 8

all_ternaryFunction · 0.90
ternary_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…