(self)
| 2036 | self.check_traceback_format(cleanup_tb) |
| 2037 | |
| 2038 | def test_stack_format(self): |
| 2039 | # Verify _stack functions. Note we have to use _getframe(1) to |
| 2040 | # compare them without this frame appearing in the output |
| 2041 | with captured_output("stderr") as ststderr: |
| 2042 | traceback.print_stack(sys._getframe(1)) |
| 2043 | stfile = StringIO() |
| 2044 | traceback.print_stack(sys._getframe(1), file=stfile) |
| 2045 | self.assertEqual(ststderr.getvalue(), stfile.getvalue()) |
| 2046 | |
| 2047 | stfmt = traceback.format_stack(sys._getframe(1)) |
| 2048 | |
| 2049 | self.assertEqual(ststderr.getvalue(), "".join(stfmt)) |
| 2050 | |
| 2051 | def test_print_stack(self): |
| 2052 | def prn(): |
nothing calls this directly
no test coverage detected