Author: Colin Valliant <alcarithe...@gmail.com>
Branch: pep526
Changeset: r93921:c9cec4aab2cc
Date: 2018-02-14 22:09 -0800
http://bitbucket.org/pypy/pypy/changeset/c9cec4aab2cc/

Log:    Catch expected exception in test_annotations.

diff --git a/pypy/interpreter/test/test_annotations.py 
b/pypy/interpreter/test/test_annotations.py
--- a/pypy/interpreter/test/test_annotations.py
+++ b/pypy/interpreter/test/test_annotations.py
@@ -59,8 +59,13 @@
         class C:
             def __init__(self):
                 self.x: invalid_name = 1
-                y[0]: also_invalid
                 assert self.x == 1
+                try:
+                    # this is invalid because `y` is undefined
+                    # it should raise a NameError
+                    y[0]: also_invalid
+                except NameError:
+                    ...
         C()
         '''
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to