From a02441e5b259e5858453a853207260c9bd4efbb5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 29 Mar 2019 16:38:55 +0100 Subject: [PATCH] Fix IntArrayText dtype is a constructor arg, not a metadata tag I think it was a coincidence that the early bad_value tests failed with old numpy. They pass as dtype=object with recent numpy --- traittypes/tests/test_traittypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traittypes/tests/test_traittypes.py b/traittypes/tests/test_traittypes.py index fc6eb10..f673957 100644 --- a/traittypes/tests/test_traittypes.py +++ b/traittypes/tests/test_traittypes.py @@ -17,7 +17,7 @@ class IntArrayTrait(HasTraits): - value = Array().tag(dtype=np.int) + value = Array(dtype=np.int) class TestIntArray(TraitTestBase): @@ -27,7 +27,7 @@ class TestIntArray(TraitTestBase): obj = IntArrayTrait() _good_values = [1, [1, 2, 3], [[1, 2, 3], [4, 5, 6]], np.array([1])] - _bad_values = [[1, [0, 0]]] + _bad_values = [[1, [0, 0]], ['str'], 'str'] def assertEqual(self, v1, v2): return np.testing.assert_array_equal(v1, v2)