(self, code)
| 19 | class TestLLTrace(unittest.TestCase): |
| 20 | |
| 21 | def run_code(self, code): |
| 22 | code = textwrap.dedent(code).strip() |
| 23 | with open(os_helper.TESTFN, 'w', encoding='utf-8') as fd: |
| 24 | self.addCleanup(os_helper.unlink, os_helper.TESTFN) |
| 25 | fd.write(code) |
| 26 | status, stdout, stderr = assert_python_ok(os_helper.TESTFN) |
| 27 | self.assertEqual(stderr, b"") |
| 28 | self.assertEqual(status, 0) |
| 29 | result = stdout.decode('utf-8') |
| 30 | if support.verbose: |
| 31 | print("\n\n--- code ---") |
| 32 | print(code) |
| 33 | print("\n--- stdout ---") |
| 34 | print(result) |
| 35 | print() |
| 36 | return result |
| 37 | |
| 38 | def test_lltrace(self): |
| 39 | stdout = self.run_code(""" |
no test coverage detected