(self, tree)
| 2641 | self.assertEqual(ast.get_docstring(tree), 'docstring') |
| 2642 | |
| 2643 | def get_load_const(self, tree): |
| 2644 | # Compile to bytecode, disassemble and get parameter of LOAD_CONST |
| 2645 | # instructions |
| 2646 | co = compile(tree, '<string>', 'exec') |
| 2647 | consts = [] |
| 2648 | for instr in dis.get_instructions(co): |
| 2649 | if instr.opcode in dis.hasconst: |
| 2650 | consts.append(instr.argval) |
| 2651 | return consts |
| 2652 | |
| 2653 | @support.cpython_only |
| 2654 | def test_load_const(self): |
no test coverage detected