Author: Brian Kearns <[email protected]>
Branch:
Changeset: r68498:4e4d5daef8fe
Date: 2013-12-19 18:17 -0500
http://bitbucket.org/pypy/pypy/changeset/4e4d5daef8fe/
Log: cleanup
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2978,17 +2978,18 @@
assert j[0] == 12
k = fromstring(self.float16val, dtype='float16')
assert k[0] == dtype('float16').type(5.)
- dt = array([5],dtype='longfloat').dtype
- if dt.itemsize == 12:
+ dt = array([5], dtype='longfloat').dtype
+ if dt.itemsize == 8:
+ m = fromstring('\x00\x00\x00\x00\x00\x00\x14@',
+ dtype='float64')
+ elif dt.itemsize == 12:
m = fromstring('\x00\x00\x00\x00\x00\x00\x00\xa0\x01@\x00\x00',
dtype='float96')
elif dt.itemsize == 16:
m = fromstring('\x00\x00\x00\x00\x00\x00\x00\xa0\x01@\x00\x00' \
'\x00\x00\x00\x00', dtype='float128')
- elif dt.itemsize == 8:
- skip('longfloat is float64')
else:
- skip('unknown itemsize for longfloat')
+ assert False, 'unknown itemsize for longfloat'
assert m[0] == dtype('longfloat').type(5.)
def test_fromstring_invalid(self):
@@ -3311,14 +3312,16 @@
a = array([('aaaa', 1.0, 8.0, [[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]])],
dtype=dt)
- s = str(a)
i = a.item()
assert isinstance(i, tuple)
assert len(i) == 4
- skip('incorrect formatting via dump_data')
- assert s.endswith("[('aaaa', 1.0, 8.0, [[[1, 2, 3], [4, 5, 6]], "
- "[[7, 8, 9], [10, 11, 12]]])]")
-
+ import sys
+ if '__pypy__' not in sys.builtin_module_names:
+ assert str(a) == "[('aaaa', 1.0, 8.0, [[[1, 2, 3], [4, 5, 6]], " \
+ "[[7, 8, 9], [10, 11,
12]]])]"
+ else:
+ assert str(a) == "array([('aaaa', 1.0, 8.0, [1, 2, 3, 4, 5, 6, " \
+ "7, 8, 9, 10, 11,
12])])"
def test_issue_1589(self):
import numpypy as numpy
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py
b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -390,23 +390,17 @@
assert (a == ref).all()
def test_signbit(self):
- from numpypy import signbit, add
-
+ from numpy import signbit, add
+ assert signbit(add.identity) == False
assert (signbit([0, 0.0, 1, 1.0, float('inf')]) ==
- [False, False, False, False, False]).all()
+ [False, False, False, False, False]).all()
assert (signbit([-0, -0.0, -1, -1.0, float('-inf')]) ==
- [False, True, True, True, True]).all()
-
- a = add.identity
- assert signbit(a) == False
-
- skip('sign of nan is non-determinant')
+ [False, True, True, True, True]).all()
assert (signbit([float('nan'), float('-nan'), -float('nan')]) ==
- [False, True, True]).all()
+ [False, True, True]).all()
def test_reciprocal(self):
- from numpypy import array, reciprocal
-
+ from numpy import array, reciprocal
inf = float('inf')
nan = float('nan')
reference = [-0.2, inf, -inf, 2.0, nan]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit