[Python-checkins] r74018 - python/branches/py3k/Lib/test/test_array.py

alexandre.vassalotti python-checkins at python.org
Wed Jul 15 22:53:55 CEST 2009


Author: alexandre.vassalotti
Date: Wed Jul 15 22:53:55 2009
New Revision: 74018
Log:
Don't check 64-bit test cases on 32-bit machine.
Modified:
 python/branches/py3k/Lib/test/test_array.py
Modified: python/branches/py3k/Lib/test/test_array.py
==============================================================================
--- python/branches/py3k/Lib/test/test_array.py	(original)
+++ python/branches/py3k/Lib/test/test_array.py	Wed Jul 15 22:53:55 2009
@@ -107,6 +107,17 @@
 (['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 @@
 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,


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /