MCPcopy Create free account
hub / github.com/python/cpython / test_dis_with_all_positions

Method test_dis_with_all_positions

Lib/test/test_dis.py:1061–1072  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1059
1060 @requires_debug_ranges()
1061 def test_dis_with_all_positions(self):
1062 def format_instr_positions(instr):
1063 values = tuple('?' if p is None else p for p in instr.positions)
1064 return '%s:%s-%s:%s' % (values[0], values[2], values[1], values[3])
1065
1066 instrs = list(dis.get_instructions(_f))
1067 for instr in instrs:
1068 with self.subTest(instr=instr):
1069 self.assertTrue(all(p is not None for p in instr.positions))
1070 positions = tuple(map(format_instr_positions, instrs))
1071 expected = dis_f_with_positions_format % positions
1072 self.do_disassembly_test(_f, expected, show_positions=True)
1073
1074 @requires_debug_ranges()
1075 def test_dis_with_some_positions(self):

Callers

nothing calls this directly

Calls 5

do_disassembly_testMethod · 0.95
listClass · 0.85
get_instructionsMethod · 0.80
assertTrueMethod · 0.80
subTestMethod · 0.45

Tested by

no test coverage detected