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

Method test_iteration

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

Source from the content-addressed store, hash-verified

2335 self.assertRaises(TypeError, dis.Bytecode, object())
2336
2337 def test_iteration(self):
2338 for obj in [_f, _C(1).__init__, "a=1", _f.__code__]:
2339 with self.subTest(obj=obj):
2340 via_object = list(dis.Bytecode(obj))
2341 via_generator = list(dis.get_instructions(obj))
2342 self.assertInstructionsEqual(via_object, via_generator)
2343
2344 def test_explicit_first_line(self):
2345 actual = dis.Bytecode(outer, first_line=expected_outer_line)

Callers

nothing calls this directly

Calls 5

listClass · 0.85
get_instructionsMethod · 0.80
_CClass · 0.70
subTestMethod · 0.45

Tested by

no test coverage detected