MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_print_stack

Method test_print_stack

Lib/test/test_traceback.py:2051–2062  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2049 self.assertEqual(ststderr.getvalue(), "".join(stfmt))
2050
2051 def test_print_stack(self):
2052 def prn():
2053 traceback.print_stack()
2054 with captured_output("stderr") as stderr:
2055 prn()
2056 lineno = prn.__code__.co_firstlineno
2057 self.assertEqual(stderr.getvalue().splitlines()[-4:], [
2058 ' File "%s", line %d, in test_print_stack' % (__file__, lineno+3),
2059 ' prn()',
2060 ' File "%s", line %d, in prn' % (__file__, lineno+1),
2061 ' traceback.print_stack()',
2062 ])
2063
2064 # issue 26823 - Shrink recursive tracebacks
2065 def _check_recursive_traceback_display(self, render_exc):

Callers

nothing calls this directly

Calls 4

captured_outputFunction · 0.90
assertEqualMethod · 0.45
splitlinesMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected