[pypy-svn] r61427 - pypy/trunk/lib-python/modified-2.5.2/test
fijal at codespeak.net
fijal at codespeak.net
Wed Jan 28 17:46:25 CET 2009
Author: fijal
Date: Wed Jan 28 17:46:24 2009
New Revision: 61427
Added:
pypy/trunk/lib-python/modified-2.5.2/test/test_syntax.py
- copied, changed from r61425, pypy/trunk/lib-python/2.5.2/test/test_syntax.py
Log:
a go at test_syntax. it passes, besides some doctests. some are real and
some are obscure
Copied: pypy/trunk/lib-python/modified-2.5.2/test/test_syntax.py (from r61425, pypy/trunk/lib-python/2.5.2/test/test_syntax.py)
==============================================================================
--- pypy/trunk/lib-python/2.5.2/test/test_syntax.py (original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_syntax.py Wed Jan 28 17:46:24 2009
@@ -3,9 +3,9 @@
Here's an example of the sort of thing that is tested.
>>> def f(x):
-... global x
+... global x # doctest: +ELLIPSIS
Traceback (most recent call last):
-SyntaxError: name 'x' is local and global
+SyntaxError: name 'x' is ... global...
The tests are all raise SyntaxErrors. They were created by checking
each C call that raises SyntaxError. There are several modules that
@@ -29,23 +29,23 @@
TODO(jhylton): "assignment to None" is inconsistent with other messages
->>> obj.None = 1
+>>> obj.None = 1 # doctest: +ELLIPSIS
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[1]>, line 1)
+SyntaxError: assignment to None ...(<doctest test.test_syntax[1]>, line 1)
->>> None = 1
+>>> None = 1 # doctest: +ELLIPSIS
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[2]>, line 1)
+SyntaxError: assignment to None ...(<doctest test.test_syntax[2]>, line 1)
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
runtime.
->>> () = 1
+>>> () = 1 # doctest: +ELLIPSIS
Traceback (most recent call last):
-SyntaxError: can't assign to () (<doctest test.test_syntax[3]>, line 1)
+SyntaxError: can't assign to ... (<doctest test.test_syntax[3]>, line 1)
->>> f() = 1
+>>> f() = 1 # doctest: +ELLIPSIS
Traceback (most recent call last):
SyntaxError: can't assign to function call (<doctest test.test_syntax[4]>, line 1)
More information about the Pypy-commit
mailing list