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

Function testcommon

Lib/test/test_format.py:51–69  ·  view source on GitHub ↗
(formatstr, args, output=None, limit=None, overflowok=False)

Source from the content-addressed store, hash-verified

49 print('yes')
50
51def testcommon(formatstr, args, output=None, limit=None, overflowok=False):
52 # if formatstr is a str, test str, bytes, and bytearray;
53 # otherwise, test bytes and bytearray
54 if isinstance(formatstr, str):
55 testformat(formatstr, args, output, limit, overflowok)
56 b_format = formatstr.encode('ascii')
57 else:
58 b_format = formatstr
59 ba_format = bytearray(b_format)
60 if output is None:
61 b_output = ba_output = None
62 else:
63 if isinstance(output, str):
64 b_output = output.encode('ascii')
65 else:
66 b_output = output
67 ba_output = bytearray(b_output)
68 testformat(b_format, args, b_output, limit, overflowok)
69 testformat(ba_format, args, ba_output, limit, overflowok)
70
71def test_exc(formatstr, args, exception, excmsg):
72 try:

Callers 3

test_common_formatMethod · 0.85
test_nulMethod · 0.85

Calls 2

testformatFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…