(self, tree)
| 2663 | self.assertEqual(ast.get_docstring(tree), 'docstring') |
| 2664 | |
| 2665 | def get_load_const(self, tree): |
| 2666 | # Compile to bytecode, disassemble and get parameter of LOAD_CONST |
| 2667 | # instructions |
| 2668 | co = compile(tree, '<string>', 'exec') |
| 2669 | consts = [] |
| 2670 | for instr in dis.get_instructions(co): |
| 2671 | if instr.opcode in dis.hasconst: |
| 2672 | consts.append(instr.argval) |
| 2673 | return consts |
| 2674 | |
| 2675 | @support.cpython_only |
| 2676 | def test_load_const(self): |
no test coverage detected