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

Method test_nested

Lib/test/test_compile.py:3002–3013  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3000 self.compare_instructions(seq, [ex + (0,0,0) for ex in expected])
3001
3002 def test_nested(self):
3003 seq = _testinternalcapi.new_instruction_sequence()
3004 seq.addop(opcode.opmap['LOAD_CONST'], 1, 1, 0, 0, 0)
3005 nested = _testinternalcapi.new_instruction_sequence()
3006 nested.addop(opcode.opmap['LOAD_CONST'], 2, 2, 0, 0, 0)
3007
3008 self.compare_instructions(seq, [('LOAD_CONST', 1, 1, 0, 0, 0)])
3009 self.compare_instructions(nested, [('LOAD_CONST', 2, 2, 0, 0, 0)])
3010
3011 seq.add_nested(nested)
3012 self.compare_instructions(seq, [('LOAD_CONST', 1, 1, 0, 0, 0)])
3013 self.compare_instructions(seq.get_nested()[0], [('LOAD_CONST', 2, 2, 0, 0, 0)])
3014
3015 def test_static_attributes_are_sorted(self):
3016 code = (

Callers

nothing calls this directly

Calls 2

compare_instructionsMethod · 0.95
get_nestedMethod · 0.80

Tested by

no test coverage detected