c8ca126fdd
* Sun Aug 5 2012 David Malcolm <dmalcolm@redhat.com> - 1:1.6.2-5 - rework patches for 3.3 to more directly reflect upstream's commits - re-enable test suite on python 3 - forcibly regenerate Cython .c source to avoid import issues on Python 3.3
70 lines
2.7 KiB
Diff
70 lines
2.7 KiB
Diff
diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1.6.2/numpy/core/tests/test_multiarray.py
|
|
--- numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray 2012-05-19 09:51:54.000000000 -0400
|
|
+++ numpy-1.6.2/numpy/core/tests/test_multiarray.py 2012-08-05 09:36:17.138719006 -0400
|
|
@@ -13,6 +13,15 @@ from numpy.compat import asbytes, getexc
|
|
|
|
from test_print import in_foreign_locale
|
|
|
|
+if sys.version_info[:2] > (3, 2):
|
|
+ # In Python 3.3 the representation of empty shape, strides and suboffsets
|
|
+ # is an empty tuple instead of None.
|
|
+ # http://docs.python.org/dev/whatsnew/3.3.html#api-changes
|
|
+ EMPTY = ()
|
|
+else:
|
|
+ EMPTY = None
|
|
+
|
|
+
|
|
class TestFlags(TestCase):
|
|
def setUp(self):
|
|
self.a = arange(10)
|
|
@@ -2162,7 +2171,7 @@ if sys.version_info >= (2, 6):
|
|
assert_equal(y.shape, (5,))
|
|
assert_equal(y.ndim, 1)
|
|
assert_equal(y.strides, (4,))
|
|
- assert_equal(y.suboffsets, None)
|
|
+ assert_equal(y.suboffsets, EMPTY)
|
|
assert_equal(y.itemsize, 4)
|
|
|
|
def test_export_simple_nd(self):
|
|
@@ -2172,7 +2181,7 @@ if sys.version_info >= (2, 6):
|
|
assert_equal(y.shape, (2, 2))
|
|
assert_equal(y.ndim, 2)
|
|
assert_equal(y.strides, (16, 8))
|
|
- assert_equal(y.suboffsets, None)
|
|
+ assert_equal(y.suboffsets, EMPTY)
|
|
assert_equal(y.itemsize, 8)
|
|
|
|
def test_export_discontiguous(self):
|
|
@@ -2182,7 +2191,7 @@ if sys.version_info >= (2, 6):
|
|
assert_equal(y.shape, (3, 3))
|
|
assert_equal(y.ndim, 2)
|
|
assert_equal(y.strides, (36, 4))
|
|
- assert_equal(y.suboffsets, None)
|
|
+ assert_equal(y.suboffsets, EMPTY)
|
|
assert_equal(y.itemsize, 4)
|
|
|
|
def test_export_record(self):
|
|
@@ -2214,7 +2223,7 @@ if sys.version_info >= (2, 6):
|
|
y = memoryview(x)
|
|
assert_equal(y.shape, (1,))
|
|
assert_equal(y.ndim, 1)
|
|
- assert_equal(y.suboffsets, None)
|
|
+ assert_equal(y.suboffsets, EMPTY)
|
|
|
|
sz = sum([dtype(b).itemsize for a, b in dt])
|
|
if dtype('l').itemsize == 4:
|
|
@@ -2228,10 +2237,10 @@ if sys.version_info >= (2, 6):
|
|
x = np.array(([[1,2],[3,4]],), dtype=[('a', ('i', (2,2)))])
|
|
y = memoryview(x)
|
|
assert_equal(y.format, 'T{(2,2)i:a:}')
|
|
- assert_equal(y.shape, None)
|
|
+ assert_equal(y.shape, EMPTY)
|
|
assert_equal(y.ndim, 0)
|
|
- assert_equal(y.strides, None)
|
|
- assert_equal(y.suboffsets, None)
|
|
+ assert_equal(y.strides, EMPTY)
|
|
+ assert_equal(y.suboffsets, EMPTY)
|
|
assert_equal(y.itemsize, 16)
|
|
|
|
def test_export_endian(self):
|