(self)
| 641 | maxDiff = None |
| 642 | |
| 643 | def test_file(self): |
| 644 | filename = os_helper.TESTFN |
| 645 | self.addCleanup(os_helper.unlink, filename) |
| 646 | with open(filename, 'w') as f: |
| 647 | f.write(TEST_CODE) |
| 648 | with support.captured_stdout() as stdout: |
| 649 | symtable.main([filename]) |
| 650 | out = stdout.getvalue() |
| 651 | self.assertIn('\n\n', out) |
| 652 | self.assertNotIn('\n\n\n', out) |
| 653 | lines = out.splitlines() |
| 654 | self.assertIn(f"symbol table for module from file {filename!r}:", lines) |
| 655 | self.assertIn(" local symbol 'glob': def_local", lines) |
| 656 | self.assertIn(" global_implicit symbol 'glob': use", lines) |
| 657 | self.assertIn(" local symbol 'spam': def_local", lines) |
| 658 | self.assertIn(" symbol table for function 'spam':", lines) |
| 659 | |
| 660 | def test_stdin(self): |
| 661 | with support.captured_stdin() as stdin: |
nothing calls this directly
no test coverage detected