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

Method test_cli_converters

Lib/test/test_clinic.py:3130–3204  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3128 self.assertIn("usage: clinic.py", out)
3129
3130 def test_cli_converters(self):
3131 prelude = dedent("""
3132 Legacy converters:
3133 B C D L O S U Y Z Z#
3134 b c d f h i l p s s# s* u u# w* y y# y* z z# z*
3135
3136 Converters:
3137 """)
3138 expected_converters = (
3139 "bool",
3140 "byte",
3141 "char",
3142 "defining_class",
3143 "double",
3144 "fildes",
3145 "float",
3146 "int",
3147 "long",
3148 "long_long",
3149 "object",
3150 "Py_buffer",
3151 "Py_complex",
3152 "Py_ssize_t",
3153 "Py_UNICODE",
3154 "PyByteArrayObject",
3155 "PyBytesObject",
3156 "self",
3157 "short",
3158 "size_t",
3159 "slice_index",
3160 "str",
3161 "uint16",
3162 "uint32",
3163 "uint64",
3164 "uint8",
3165 "unicode",
3166 "unicode_fs_decoded",
3167 "unicode_fs_encoded",
3168 "unsigned_char",
3169 "unsigned_int",
3170 "unsigned_long",
3171 "unsigned_long_long",
3172 "unsigned_short",
3173 )
3174 finale = dedent("""
3175 Return converters:
3176 bool()
3177 double()
3178 float()
3179 int()
3180 long()
3181 object()
3182 Py_ssize_t()
3183 size_t()
3184 unsigned_int()
3185 unsigned_long()
3186
3187 All converters also accept (c_default=None, py_default=None, annotation=None).

Callers

nothing calls this directly

Calls 9

expect_successMethod · 0.95
dedentFunction · 0.90
assertStartsWithMethod · 0.80
assertEndsWithMethod · 0.80
removeprefixMethod · 0.45
removesuffixMethod · 0.45
splitMethod · 0.45
lstripMethod · 0.45
subTestMethod · 0.45

Tested by

no test coverage detected