summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-10-17 15:49:18 -0500
committerGitHub <noreply@github.com>2018-10-17 15:49:18 -0500
commit25a37a9c0a9b2cf0de0b221c53da92a8d34e92d5 (patch)
tree1ac045994272d12a6acb412615b6608901ddd3a6 /numpy/lib/tests
parentf85c71a6d16ab64695f07fde23e2c19104d36208 (diff)
parent2ddba2a474a673131c67d011cfcb76a47b869072 (diff)
downloadnumpy-25a37a9c0a9b2cf0de0b221c53da92a8d34e92d5.tar.gz
Merge pull request #12153 from tylerjereddy/setdiff1d_test_cov
DOC, TST: cover setdiff1d assume_unique
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_arraysetops.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 4b61726d2..fef06ba53 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -388,6 +388,13 @@ class TestSetOps(object):
a = np.array((), np.uint32)
assert_equal(setdiff1d(a, []).dtype, np.uint32)
+ def test_setdiff1d_unique(self):
+ a = np.array([3, 2, 1])
+ b = np.array([7, 5, 2])
+ expected = np.array([3, 1])
+ actual = setdiff1d(a, b, assume_unique=True)
+ assert_equal(actual, expected)
+
def test_setdiff1d_char_array(self):
a = np.array(['a', 'b', 'c'])
b = np.array(['a', 'b', 's'])