Skip to content

Commit 1fd6a65

Browse files
committed
tests: distmatrix returns numpy datatypes
1 parent 6f67db7 commit 1fd6a65

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Orange/tests/test_distances.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,17 @@ def test_save(self):
186186
["danny", "eve", "frank"])
187187
self.assertEqual(m.axis, 0)
188188

189+
def test_numpy_type(self):
190+
"""GH-3658"""
191+
data1 = np.array([1, 2], dtype=np.int64)
192+
data2 = np.array([2, 3], dtype=np.int64)
193+
dm1, dm2 = DistMatrix(data1), DistMatrix(data2)
194+
195+
self.assertIsInstance(dm1.max(), np.int64)
196+
self.assertNotIsInstance(dm1.max(), int)
197+
with self.assertRaises(AssertionError):
198+
np.testing.assert_array_equal(dm1, dm2)
199+
189200

190201
# noinspection PyTypeChecker
191202
class TestEuclidean(TestCase):

0 commit comments

Comments
 (0)