MCPcopy Create free account
hub / github.com/ipython/ipython / doctest_tb_context

Function doctest_tb_context

IPython/core/tests/test_iplib.py:58–87  ·  view source on GitHub ↗

In [3]: xmode context Exception reporting mode: Context In [4]: run simpleerr.py --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) ... in 30 mode = 'div' 31

()

Source from the content-addressed store, hash-verified

56
57
58def doctest_tb_context():
59 """
60In [3]: xmode context
61Exception reporting mode: Context
62
63In [4]: run simpleerr.py
64---------------------------------------------------------------------------
65ZeroDivisionError Traceback (most recent call last)
66<BLANKLINE>
67... in <module>
68 30 mode = 'div'
69 31
70---> 32 bar(mode)
71<BLANKLINE>
72... in bar(mode)
73 14 "bar"
74 15 if mode=='div':
75---> 16 div0()
76 17 elif mode=='exit':
77 18 try:
78<BLANKLINE>
79... in div0()
80 6 x = 1
81 7 y = 0
82----> 8 x/y
83 9
84 10 def sysexit(stat, mode):
85<BLANKLINE>
86ZeroDivisionError: ...
87"""
88
89
90def doctest_tb_verbose():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected