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

Function check_untested

Modules/_decimal/tests/deccheck.py:1124–1144  ·  view source on GitHub ↗

Determine untested, C-only and Python-only attributes. Uncomment print lines for debugging.

(funcdict, c_cls, p_cls)

Source from the content-addressed store, hash-verified

1122
1123
1124def check_untested(funcdict, c_cls, p_cls):
1125 """Determine untested, C-only and Python-only attributes.
1126 Uncomment print lines for debugging."""
1127 c_attr = set(dir(c_cls))
1128 p_attr = set(dir(p_cls))
1129 intersect = c_attr & p_attr
1130
1131 funcdict['c_only'] = tuple(sorted(c_attr-intersect))
1132 funcdict['p_only'] = tuple(sorted(p_attr-intersect))
1133
1134 tested = set()
1135 for lst in funcdict.values():
1136 for v in lst:
1137 v = v.replace("context.", "") if c_cls == C.Context else v
1138 tested.add(v)
1139
1140 funcdict['untested'] = tuple(sorted(intersect-tested))
1141
1142 # for key in ('untested', 'c_only', 'p_only'):
1143 # s = 'Context' if c_cls == C.Context else 'Decimal'
1144 # print("\n%s %s:\n%s" % (s, key, funcdict[key]))
1145
1146
1147if __name__ == '__main__':

Callers 1

deccheck.pyFile · 0.85

Calls 4

setFunction · 0.85
valuesMethod · 0.45
replaceMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…