10000 BUG: Fix various Big-Endian test failures (ppc64) by charris · Pull Request #10561 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix various Big-Endian test failures (ppc64) #10561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions numpy/core/tests/test_arrayprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class sub(np.ndarray): pass
' [3, 4]])')

# two dimensional with flexible dtype
xstruct = np.ones((2,2), dtype=[('a', 'i4')]).view(sub)
xstruct = np.ones((2,2), dtype=[('a', '<i4')]).view(sub)
assert_equal(repr(xstruct),
"sub([[(1,), (1,)],\n"
" [(1,), (1,)]], dtype=[('a', '<i4')])"
Expand Down Expand Up @@ -362,13 +362,14 @@ def test_formatter_reset(self):

def test_0d_arrays(self):
unicode = type(u'')
assert_equal(unicode(np.array(u'café', np.unicode_)), u'café')

assert_equal(unicode(np.array(u'café', '<U4')), u'café')

if sys.version_info[0] >= 3:
assert_equal(repr(np.array('café', np.unicode_)),
assert_equal(repr(np.array('café', '<U4')),
"array('café', dtype='<U4')")
else:
assert_equal(repr(np.array(u'café', np.unicode_)),
assert_equal(repr(np.array(u'café', '<U4')),
"array(u'caf\\xe9', dtype='<U4')")
assert_equal(str(np.array('test', np.str_)), 'test')

Expand Down Expand Up @@ -477,7 +478,7 @@ def test_float_overflow_nowarn(self):
repr(np.array([1e4, 0.1], dtype='f2'))

def test_sign_spacing_structured(self):
a = np.ones(2, dtype='f,f')
a = np.ones(2, dtype='<f,<f')
assert_equal(repr(a),
"array([(1., 1.), (1., 1.)], dtype=[('f0', '<f4'), ('f1', '<f4')])")
assert_equal(repr(a[0]), "(1., 1.)")
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/tests/test_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_dtype(self):
assert_(dt.byteorder != dt2.byteorder, "bogus test")
assert_dtype_equal(dt, dt2)
else:
self.assertTrue(dt.byteorder != dt3.byteorder, "bogus test")
assert_(dt.byteorder != dt3.byteorder, "bogus test")
assert_dtype_equal(dt, dt3)

def test_equivalent_dtype_hashing(self):
Expand Down
3 changes: 1 addition & 2 deletions numpy/core/tests/test_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def test_recarray_repr(self):
assert_(repr(a).find('dtype=int32') != -1)

def test_0d_recarray_repr(self):
# testing infered integer types is unpleasant due to sizeof(int) varying
arr_0d = np.rec.array((np.int32(1), 2.0, np.datetime64('2003')))
arr_0d = np.rec.array((1, 2.0, '2003'), dtype='<i4,<f8,<M8[Y]')
assert_equal(repr(arr_0d), textwrap.dedent("""\
rec.array((1, 2., '2003'),
dtype=[('f0', '<i4'), ('f1', '<f8'), ('f2', '<M8[Y]')])"""))
Expand Down
2 changes: 2 additions & 0 deletions numpy/core/tests/test_scalarmath.py 9539
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import warnings
import itertools
import operator
import platform

import numpy as np
from numpy.testing import (
Expand Down Expand Up @@ -420,6 +421,7 @@ def test_int_from_infinite_longdouble___int__(self):
assert_raises(OverflowError, x.__int__)
assert_equal(len(sup.log), 1)

@dec.knownfailureif(platform.machine().startswith("ppc64"))
@dec.skipif(np.finfo(np.double) == np.finfo(np.longdouble))
def test_int_from_huge_longdouble(self):
# Produce a longdouble that would overflow a double,
Expand Down
0