[pypy-commit] pypy py3.5-refactor-sys_exc_info: another test, written yesterday, which passes now on this branch
arigo
pypy.commits at gmail.com
Wed Nov 16 13:40:42 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5-refactor-sys_exc_info
Changeset: r88416:1ad303c4a87c
Date: 2016-11-16 18:50 +0000
http://bitbucket.org/pypy/pypy/changeset/1ad303c4a87c/
Log: another test, written yesterday, which passes now on this branch
diff --git a/pypy/interpreter/test/test_raise.py b/pypy/interpreter/test/test_raise.py
--- a/pypy/interpreter/test/test_raise.py
+++ b/pypy/interpreter/test/test_raise.py
@@ -79,6 +79,25 @@
assert sys.exc_info()[0] is ValueError
assert sys.exc_info() == (None, None, None)
+ def test_revert_exc_info_2_finally(self):
+ import sys
+ assert sys.exc_info() == (None, None, None)
+ try:
+ try:
+ raise ValueError
+ finally:
+ try:
+ try:
+ raise IndexError
+ finally:
+ assert sys.exc_info()[0] is IndexError
+ except IndexError:
+ pass
+ assert sys.exc_info()[0] is ValueError
+ except ValueError:
+ pass
+ assert sys.exc_info() == (None, None, None)
+
def test_reraise_1(self):
raises(IndexError, """
import sys
More information about the pypy-commit
mailing list