summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2010-02-20 18:06:53 +0000
committerPauli Virtanen <pav@iki.fi>2010-02-20 18:06:53 +0000
commit997891720d2a8a1298ed0ae68abe41c2dc7a1c86 (patch)
tree163b2ef2e6e6aec5966bde2e159c2d27a9145763
parent77f8ea3de6190178e78669d235c90c91bfee5e61 (diff)
downloadnumpy-997891720d2a8a1298ed0ae68abe41c2dc7a1c86.tar.gz
3K: BUG: make test_defchararray convert properly via 2to3
-rw-r--r--numpy/core/tests/test_defchararray.py9
-rwxr-xr-xtools/py3tool.py1
2 files changed, 6 insertions, 4 deletions
diff --git a/numpy/core/tests/test_defchararray.py b/numpy/core/tests/test_defchararray.py
index 721e7fb3c..358aebe68 100644
--- a/numpy/core/tests/test_defchararray.py
+++ b/numpy/core/tests/test_defchararray.py
@@ -4,6 +4,9 @@ import numpy as np
import sys
from numpy.core.multiarray import _vec_string
+kw_unicode_true = {'unicode': True}
+kw_unicode_false = {'unicode': False}
+
class TestBasic(TestCase):
def test_from_object_array(self):
A = np.array([['abc', 2],
@@ -16,7 +19,7 @@ class TestBasic(TestCase):
A = np.array([['abc', u'Sigma \u03a3'],
['long ', '0123456789']], dtype='O')
self.failUnlessRaises(ValueError, np.char.array, (A,))
- B = np.char.array(A, unicode=True)
+ B = np.char.array(A, **kw_unicode_true)
assert_equal(B.dtype.itemsize, 10 * np.array('a', 'U').dtype.itemsize)
assert_array_equal(B, [['abc', u'Sigma \u03a3'], ['long', '0123456789']])
@@ -45,12 +48,12 @@ class TestBasic(TestCase):
assert_array_equal(B, A)
assert_equal(B.dtype, A.dtype)
assert_equal(B.shape, A.shape)
- B = np.char.array(A, unicode=True)
+ B = np.char.array(A, **kw_unicode_true)
assert_array_equal(B, A)
assert_equal(B.dtype, A.dtype)
assert_equal(B.shape, A.shape)
def fail():
- B = np.char.array(A, unicode=False)
+ B = np.char.array(A, **kw_unicode_false)
self.failUnlessRaises(UnicodeEncodeError, fail)
def test_unicode_upconvert(self):
diff --git a/tools/py3tool.py b/tools/py3tool.py
index d1a587d6b..33c20022c 100755
--- a/tools/py3tool.py
+++ b/tools/py3tool.py
@@ -35,7 +35,6 @@ EXTRA_2TO3_FLAGS = {
'numpy/core/code_generators/generate_numpy_api.py': '-x import',
'numpy/core/code_generators/generate_ufunc_api.py': '-x import',
'numpy/core/defchararray.py': '-x unicode',
- 'numpy/core/tests/test_defchararray.py': '-x unicode',
'numpy/compat/py3k.py': '-x unicode',
}