(self)
| 1963 | self.check_traceback_format(cleanup_tb) |
| 1964 | |
| 1965 | def test_stack_format(self): |
| 1966 | # Verify _stack functions. Note we have to use _getframe(1) to |
| 1967 | # compare them without this frame appearing in the output |
| 1968 | with captured_output("stderr") as ststderr: |
| 1969 | traceback.print_stack(sys._getframe(1)) |
| 1970 | stfile = StringIO() |
| 1971 | traceback.print_stack(sys._getframe(1), file=stfile) |
| 1972 | self.assertEqual(ststderr.getvalue(), stfile.getvalue()) |
| 1973 | |
| 1974 | stfmt = traceback.format_stack(sys._getframe(1)) |
| 1975 | |
| 1976 | self.assertEqual(ststderr.getvalue(), "".join(stfmt)) |
| 1977 | |
| 1978 | def test_print_stack(self): |
| 1979 | def prn(): |
nothing calls this directly
no test coverage detected