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

Method test_instantiation

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

Source from the content-addressed store, hash-verified

2326class BytecodeTests(InstructionTestCase, DisTestBase):
2327
2328 def test_instantiation(self):
2329 # Test with function, method, code string and code object
2330 for obj in [_f, _C(1).__init__, "a=1", _f.__code__]:
2331 with self.subTest(obj=obj):
2332 b = dis.Bytecode(obj)
2333 self.assertIsInstance(b.codeobj, types.CodeType)
2334
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__]:

Callers

nothing calls this directly

Calls 4

assertIsInstanceMethod · 0.80
_CClass · 0.70
subTestMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected