[pypy-commit] pypy py3.5: generalize the expected error messages

arigo pypy.commits at gmail.com
Thu Jan 12 10:13:57 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89515:511e7a4e706b
Date: 2017-01-12 16:13 +0100
http://bitbucket.org/pypy/pypy/changeset/511e7a4e706b/

Log:	generalize the expected error messages

diff --git a/lib-python/3/test/test_syntax.py b/lib-python/3/test/test_syntax.py
--- a/lib-python/3/test/test_syntax.py
+++ b/lib-python/3/test/test_syntax.py
@@ -31,9 +31,9 @@
 Traceback (most recent call last):
 SyntaxError: invalid syntax
 
->>> None = 1
+>>> None = 1                                 # doctest: +ELLIPSIS
 Traceback (most recent call last):
-SyntaxError: can't assign to keyword
+SyntaxError: can't assign to ...
 
 It's a syntax error to assign to the empty tuple.  Why isn't it an
 error to assign to the empty list?  It will always raise some error at
@@ -234,9 +234,9 @@
 >>> (x for x in x) += 1
 Traceback (most recent call last):
 SyntaxError: can't assign to generator expression
->>> None += 1
+>>> None += 1                              # doctest: +ELLIPSIS
 Traceback (most recent call last):
-SyntaxError: can't assign to keyword
+SyntaxError: can't assign to ...
 >>> f() += 1
 Traceback (most recent call last):
 SyntaxError: can't assign to function call
@@ -501,17 +501,17 @@
 
 Corner-cases that used to fail to raise the correct error:
 
-    >>> def f(*, x=lambda __debug__:0): pass
+    >>> def f(*, x=lambda __debug__:0): pass          # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    SyntaxError: assignment to keyword
+    SyntaxError: ...assign... to ...
 
-    >>> def f(*args:(lambda __debug__:0)): pass
+    >>> def f(*args:(lambda __debug__:0)): pass       # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    SyntaxError: assignment to keyword
+    SyntaxError: ...assign... to ...
 
-    >>> def f(**kwargs:(lambda __debug__:0)): pass
+    >>> def f(**kwargs:(lambda __debug__:0)): pass    # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    SyntaxError: assignment to keyword
+    SyntaxError: ...assign... to ...
 
     >>> with (lambda *:0): pass
     Traceback (most recent call last):
@@ -519,13 +519,13 @@
 
 Corner-cases that used to crash:
 
-    >>> def f(**__debug__): pass
+    >>> def f(**__debug__): pass                      # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    SyntaxError: assignment to keyword
+    SyntaxError: ...assign... to ...
 
-    >>> def f(*xx, __debug__): pass
+    >>> def f(*xx, __debug__): pass                   # doctest: +ELLIPSIS
     Traceback (most recent call last):
-    SyntaxError: assignment to keyword
+    SyntaxError: ...assign... to ...
 
 """
 


More information about the pypy-commit mailing list