summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraysetops.py
diff options
context:
space:
mode:
authorChristian Brodbeck <christianmbrodbeck@gmail.com>2015-05-06 10:49:41 -0400
committerChristian Brodbeck <christianmbrodbeck@gmail.com>2015-05-07 09:03:16 -0400
commitc05019eda16477f4be99f47755362c07e1acb5b8 (patch)
treeeab1de86ac3332d64f9179750b726b460584d8a7 /numpy/lib/tests/test_arraysetops.py
parenteecb2e3c07f29c0ac991d364a846a2f8293a432a (diff)
downloadnumpy-c05019eda16477f4be99f47755362c07e1acb5b8.tar.gz
BUG: setdiff1d return dtype
Fixes #5846 (If called with an empty array as first argument, the returned array had dtype bool instead of the dtype of the input array)
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r--numpy/lib/tests/test_arraysetops.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 39196f4bc..852183ffe 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -5,7 +5,7 @@ from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
- run_module_suite, TestCase, assert_array_equal
+ run_module_suite, TestCase, assert_array_equal, assert_equal
)
from numpy.lib.arraysetops import (
ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, in1d
@@ -286,6 +286,8 @@ class TestSetOps(TestCase):
assert_array_equal(c, ec)
assert_array_equal([], setdiff1d([], []))
+ a = np.array((), np.uint32)
+ assert_equal(setdiff1d(a, []).dtype, np.uint32)
def test_setdiff1d_char_array(self):
a = np.array(['a', 'b', 'c'])