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

Method test_emit_dec_ref_instance

mypyc/test/test_emit.py:145–155  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 self.assert_output("CPy_XDECREF(x);\n")
144
145 def test_emit_dec_ref_instance(self) -> None:
146 self.emitter.emit_dec_ref("x", self.instance_a)
147 if HAVE_IMMORTAL:
148 self.assert_output("CPy_DECREF_NO_IMM(x);\n")
149 else:
150 self.assert_output("CPy_DECREF(x);\n")
151 self.emitter.emit_dec_ref("x", self.instance_a, is_xdec=True)
152 if HAVE_IMMORTAL:
153 self.assert_output("CPy_XDECREF_NO_IMM(x);\n")
154 else:
155 self.assert_output("CPy_XDECREF(x);\n")
156
157 def test_emit_dec_ref_optional(self) -> None:
158 optional = RUnion([self.instance_a, none_rprimitive])

Callers

nothing calls this directly

Calls 2

assert_outputMethod · 0.95
emit_dec_refMethod · 0.45

Tested by

no test coverage detected