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

Method test_get_attr_merged

mypyc/test/test_emitfunc.py:490–507  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

488 )
489
490 def test_get_attr_merged(self) -> None:
491 op = GetAttr(self.r, "y", 1)
492 branch = Branch(op, BasicBlock(8), BasicBlock(9), Branch.IS_ERROR)
493 branch.traceback_entry = ("foobar", 123)
494 self.assert_emit(
495 op,
496 """\
497 cpy_r_r0 = ((mod___AObject *)cpy_r_r)->_y;
498 if (unlikely(cpy_r_r0 == CPY_INT_TAG)) {
499 CPy_AttributeError("prog.py", "foobar", "A", "y", 123, CPyStatic_prog___globals);
500 goto CPyL8;
501 }
502 CPyTagged_INCREF(cpy_r_r0);
503 goto CPyL9;
504 """,
505 next_branch=branch,
506 skip_next=True,
507 )
508
509 def test_get_attr_with_bitmap(self) -> None:
510 self.assert_emit(

Callers

nothing calls this directly

Calls 4

assert_emitMethod · 0.95
GetAttrClass · 0.90
BranchClass · 0.90
BasicBlockClass · 0.90

Tested by

no test coverage detected