[pypy-svn] r59423 - pypy/trunk/lib-python/modified-2.5.2/test
arigo at codespeak.net
arigo at codespeak.net
Sun Oct 26 17:32:52 CET 2008
Author: arigo
Date: Sun Oct 26 17:32:49 2008
New Revision: 59423
Modified:
pypy/trunk/lib-python/modified-2.5.2/test/test_exceptions.py
Log:
These are not implementation details. The impl detail is whether
the lineno and offset can be strings or should be (as expected) integers.
So it is just a badly-written test. Fix it to pass integers.
Modified: pypy/trunk/lib-python/modified-2.5.2/test/test_exceptions.py
==============================================================================
--- pypy/trunk/lib-python/modified-2.5.2/test/test_exceptions.py (original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_exceptions.py Sun Oct 26 17:32:49 2008
@@ -6,7 +6,7 @@
import warnings
import pickle, cPickle
-from test.test_support import TESTFN, unlink, run_unittest, check_impl_detail
+from test.test_support import TESTFN, unlink, run_unittest
# XXX This is not really enough, each *operation* should be tested!
@@ -202,6 +202,8 @@
def testAttributes(self):
# test that exception attributes are happy
+ lineno = 42
+ offset = 27
exceptionList = [
(BaseException, (), {'message' : '', 'args' : ()}),
@@ -234,6 +236,20 @@
{'message' : 'msgStr', 'args' : ('msgStr',), 'text' : None,
'print_file_and_line' : None, 'msg' : 'msgStr',
'filename' : None, 'lineno' : None, 'offset' : None}),
+ (SyntaxError, ('msgStr', ('filenameStr', lineno, offset,
+ 'textStr')),
+ {'message' : '', 'offset' : offset, 'text' : 'textStr',
+ 'args' : ('msgStr', ('filenameStr', lineno,
+ offset, 'textStr')),
+ 'print_file_and_line' : None, 'msg' : 'msgStr',
+ 'filename' : 'filenameStr', 'lineno' : lineno}),
+ (SyntaxError, ('msgStr', 'filenameStr', 'linenoStr', 'offsetStr',
+ 'textStr', 'print_file_and_lineStr'),
+ {'message' : '', 'text' : None,
+ 'args' : ('msgStr', 'filenameStr', 'linenoStr', 'offsetStr',
+ 'textStr', 'print_file_and_lineStr'),
+ 'print_file_and_line' : None, 'msg' : 'msgStr',
+ 'filename' : None, 'lineno' : None, 'offset' : None}),
(UnicodeError, (), {'message' : '', 'args' : (),}),
(UnicodeEncodeError, ('ascii', u'a', 0, 1, 'ordinal not in range'),
{'message' : '', 'args' : ('ascii', u'a', 0, 1,
@@ -250,24 +266,6 @@
'object' : u'\u3042', 'reason' : 'ouch',
'start' : 0, 'end' : 1}),
]
- if check_impl_detail:
- exceptionList.append(
- (SyntaxError, ('msgStr', 'filenameStr', 'linenoStr', 'offsetStr',
- 'textStr', 'print_file_and_lineStr'),
- {'message' : '', 'text' : None,
- 'args' : ('msgStr', 'filenameStr', 'linenoStr', 'offsetStr',
- 'textStr', 'print_file_and_lineStr'),
- 'print_file_and_line' : None, 'msg' : 'msgStr',
- 'filename' : None, 'lineno' : None, 'offset' : None})
- )
- exceptionList.append(SyntaxError, ('msgStr', ('filenameStr', 'linenoStr', 'offsetStr',
- 'textStr')),
- {'message' : '', 'offset' : 'offsetStr', 'text' : 'textStr',
- 'args' : ('msgStr', ('filenameStr', 'linenoStr',
- 'offsetStr', 'textStr')),
- 'print_file_and_line' : None, 'msg' : 'msgStr',
- 'filename' : 'filenameStr', 'lineno' : 'linenoStr'})
-
try:
exceptionList.append(
(WindowsError, (1, 'strErrorStr', 'filenameStr'),
More information about the Pypy-commit
mailing list