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

Function test_quantize_api

Modules/_decimal/tests/deccheck.py:1107–1121  ·  view source on GitHub ↗

Iterate the 'quantize' method through many test cases, using the optional arguments.

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

Source from the content-addressed store, hash-verified

1105 return c
1106
1107def test_quantize_api(method, prec, exprange, restricted_range, itr, stat):
1108 """Iterate the 'quantize' method through many test cases, using
1109 the optional arguments."""
1110 for op in all_binary(prec, restricted_range, itr):
1111 for rounding in RoundModes:
1112 c = randcontext(exprange)
1113 quantizeop = (op[0], op[1], rounding, c)
1114 t = TestSet(method, quantizeop)
1115 try:
1116 if not convert(t):
1117 continue
1118 callfuncs(t)
1119 verify(t, stat)
1120 except VerifyError as err:
1121 log(err)
1122
1123
1124def check_untested(funcdict, c_cls, p_cls):

Callers

nothing calls this directly

Calls 7

all_binaryFunction · 0.90
randcontextFunction · 0.85
callfuncsFunction · 0.85
TestSetClass · 0.70
convertFunction · 0.70
verifyFunction · 0.70
logFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…