MCPcopy Index your code
hub / github.com/python/mypy / test_check_list

Method test_check_list

mypyc/test/test_emitwrapper.py:16–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14 self.context = EmitterContext(NameGenerator([["mod"]]), True)
15
16 def test_check_list(self) -> None:
17 emitter = Emitter(self.context)
18 generate_arg_check("x", list_rprimitive, emitter, ReturnHandler("NULL"))
19 lines = emitter.fragments
20 self.assert_lines(
21 [
22 "PyObject *arg_x;",
23 "if (likely(PyList_Check(obj_x)))",
24 " arg_x = obj_x;",
25 "else {",
26 ' CPy_TypeError("list", obj_x);',
27 " return NULL;",
28 "}",
29 ],
30 lines,
31 )
32
33 def test_check_int(self) -> None:
34 emitter = Emitter(self.context)

Callers

nothing calls this directly

Calls 4

assert_linesMethod · 0.95
EmitterClass · 0.90
generate_arg_checkFunction · 0.90
ReturnHandlerClass · 0.90

Tested by

no test coverage detected