Skip to content

Commit

Permalink
exclude 3.8
Browse files Browse the repository at this point in the history
import sys
  • Loading branch information
Carreau committed Oct 30, 2022
1 parent fcdcddd commit 98e3599
Showing 1 changed file with 88 additions and 86 deletions.
174 changes: 88 additions & 86 deletions IPython/core/tests/test_iplib.py
Expand Up @@ -2,6 +2,7 @@
"""

import stack_data
import sys

SV_VERSION = tuple([int(x) for x in stack_data.__version__.split(".")[0:2]])

Expand Down Expand Up @@ -165,92 +166,93 @@ def doctest_tb_sysexit():
"""


if SV_VERSION < (0, 6):

def doctest_tb_sysexit_verbose_stack_data_05():
"""
In [18]: %run simpleerr.py exit
An exception has occurred, use %tb to see the full traceback.
SystemExit: (1, 'Mode = exit')
In [19]: %run simpleerr.py exit 2
An exception has occurred, use %tb to see the full traceback.
SystemExit: (2, 'Mode = exit')
In [23]: %xmode verbose
Exception reporting mode: Verbose
In [24]: %tb
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
<BLANKLINE>
...
30 except IndexError:
31 mode = 'div'
---> 33 bar(mode)
mode = 'exit'
<BLANKLINE>
... in bar(mode='exit')
... except:
... stat = 1
---> ... sysexit(stat, mode)
mode = 'exit'
stat = 2
... else:
... raise ValueError('Unknown mode')
<BLANKLINE>
... in sysexit(stat=2, mode='exit')
10 def sysexit(stat, mode):
---> 11 raise SystemExit(stat, f"Mode = {mode}")
stat = 2
<BLANKLINE>
SystemExit: (2, 'Mode = exit')
"""

else:
# currently the only difference is
# + mode = 'exit'

def doctest_tb_sysexit_verbose_stack_data_06():
"""
In [18]: %run simpleerr.py exit
An exception has occurred, use %tb to see the full traceback.
SystemExit: (1, 'Mode = exit')
In [19]: %run simpleerr.py exit 2
An exception has occurred, use %tb to see the full traceback.
SystemExit: (2, 'Mode = exit')
In [23]: %xmode verbose
Exception reporting mode: Verbose
In [24]: %tb
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
<BLANKLINE>
...
30 except IndexError:
31 mode = 'div'
---> 33 bar(mode)
mode = 'exit'
<BLANKLINE>
... in bar(mode='exit')
... except:
... stat = 1
---> ... sysexit(stat, mode)
mode = 'exit'
stat = 2
... else:
... raise ValueError('Unknown mode')
<BLANKLINE>
... in sysexit(stat=2, mode='exit')
10 def sysexit(stat, mode):
---> 11 raise SystemExit(stat, f"Mode = {mode}")
stat = 2
mode = 'exit'
<BLANKLINE>
SystemExit: (2, 'Mode = exit')
"""
if sys.version_info >= (3, 9):
if SV_VERSION < (0, 6):

def doctest_tb_sysexit_verbose_stack_data_05():
"""
In [18]: %run simpleerr.py exit
An exception has occurred, use %tb to see the full traceback.
SystemExit: (1, 'Mode = exit')
In [19]: %run simpleerr.py exit 2
An exception has occurred, use %tb to see the full traceback.
SystemExit: (2, 'Mode = exit')
In [23]: %xmode verbose
Exception reporting mode: Verbose
In [24]: %tb
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
<BLANKLINE>
...
30 except IndexError:
31 mode = 'div'
---> 33 bar(mode)
mode = 'exit'
<BLANKLINE>
... in bar(mode='exit')
... except:
... stat = 1
---> ... sysexit(stat, mode)
mode = 'exit'
stat = 2
... else:
... raise ValueError('Unknown mode')
<BLANKLINE>
... in sysexit(stat=2, mode='exit')
10 def sysexit(stat, mode):
---> 11 raise SystemExit(stat, f"Mode = {mode}")
stat = 2
<BLANKLINE>
SystemExit: (2, 'Mode = exit')
"""

else:
# currently the only difference is
# + mode = 'exit'

def doctest_tb_sysexit_verbose_stack_data_06():
"""
In [18]: %run simpleerr.py exit
An exception has occurred, use %tb to see the full traceback.
SystemExit: (1, 'Mode = exit')
In [19]: %run simpleerr.py exit 2
An exception has occurred, use %tb to see the full traceback.
SystemExit: (2, 'Mode = exit')
In [23]: %xmode verbose
Exception reporting mode: Verbose
In [24]: %tb
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
<BLANKLINE>
...
30 except IndexError:
31 mode = 'div'
---> 33 bar(mode)
mode = 'exit'
<BLANKLINE>
... in bar(mode='exit')
... except:
... stat = 1
---> ... sysexit(stat, mode)
mode = 'exit'
stat = 2
... else:
... raise ValueError('Unknown mode')
<BLANKLINE>
... in sysexit(stat=2, mode='exit')
10 def sysexit(stat, mode):
---> 11 raise SystemExit(stat, f"Mode = {mode}")
stat = 2
mode = 'exit'
<BLANKLINE>
SystemExit: (2, 'Mode = exit')
"""

def test_run_cell():
import textwrap
Expand Down

0 comments on commit 98e3599

Please sign in to comment.