summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2009-07-15 20:53:55 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2009-07-15 20:53:55 (GMT)
commit0027d4b4feda9c4e8e2cfa30dcb19cc126706c84 (patch)
tree6e1305547868b0beb891af1351baaa8fc667c1e8 /Lib
parentae6388df22b29684519438d30da34e29725f8b5b (diff)
downloadcpython-0027d4b4feda9c4e8e2cfa30dcb19cc126706c84.zip
cpython-0027d4b4feda9c4e8e2cfa30dcb19cc126706c84.tar.gz
cpython-0027d4b4feda9c4e8e2cfa30dcb19cc126706c84.tar.bz2
Don't check 64-bit test cases on 32-bit machine.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/test/test_array.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index d94883c..ba11656 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -107,6 +107,17 @@ class ArrayReconstructorTest(unittest.TestCase):
(['i', 'l'], SIGNED_INT32_BE, '>iii',
[-1<<31, (1<<31)-1, 0]),
(['L'], UNSIGNED_INT64_LE, '<QQQQ',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['L'], UNSIGNED_INT64_BE, '>QQQQ',
+ [1<<31, (1<<31)-1, 0, (1<<32)-1]),
+ (['l'], SIGNED_INT64_LE, '<qqq',
+ [-1<<31, (1<<31)-1, 0]),
+ (['l'], SIGNED_INT64_BE, '>qqq',
+ [-1<<31, (1<<31)-1, 0]),
+ # The following tests for INT64 will raise an OverflowError
+ # when run on a 32-bit machine. The tests are simply skipped
+ # in that case.
+ (['L'], UNSIGNED_INT64_LE, '<QQQQ',
[1<<63, (1<<63)-1, 0, (1<<64)-1]),
(['L'], UNSIGNED_INT64_BE, '>QQQQ',
[1<<63, (1<<63)-1, 0, (1<<64)-1]),
@@ -127,7 +138,10 @@ class ArrayReconstructorTest(unittest.TestCase):
valid_typecodes, mformat_code, struct_fmt, values = testcase
arraystr = struct.pack(struct_fmt, *values)
for typecode in valid_typecodes:
- a = array.array(typecode, values)
+ try:
+ a = array.array(typecode, values)
+ except OverflowError:
+ continue # Skip this test case.
b = array_reconstructor(
array.array, typecode, mformat_code, arraystr)
self.assertEqual(a, b,