summaryrefslogtreecommitdiff
path: root/src/python/test
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2022-07-27 11:36:56 +0200
committerHind-M <hind.montassif@gmail.com>2022-07-27 11:36:56 +0200
commiteb0ab20bdbf624e6b20896fb2cca1af71af7d4a5 (patch)
tree234531390458105bb5e96045689df82cb6fbab3c /src/python/test
parent0505b97dd5dfa188a3d9ce421ca6992f06b13a16 (diff)
Enable keops dtm warnings
Diffstat (limited to 'src/python/test')
-rwxr-xr-xsrc/python/test/test_dtm.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/python/test/test_dtm.py b/src/python/test/test_dtm.py
index e46d616c..21cff055 100755
--- a/src/python/test/test_dtm.py
+++ b/src/python/test/test_dtm.py
@@ -91,11 +91,12 @@ def test_density():
def test_dtm_overflow_warnings():
pts = numpy.array([[10., 100000000000000000000000000000.], [1000., 100000000000000000000000000.]])
-
+ impl_warn = ["keops", "hnsw"]
with warnings.catch_warnings(record=True) as w:
- # TODO Test "keops" implementation as well when next version of pykeops (current is 1.5) is released (should fix the problem (cf. issue #543))
- dtm = DistanceToMeasure(2, implementation="hnsw")
- r = dtm.fit_transform(pts)
- assert len(w) == 1
- assert issubclass(w[0].category, RuntimeWarning)
- assert "Overflow" in str(w[0].message)
+ for impl in impl_warn:
+ dtm = DistanceToMeasure(2, implementation=impl)
+ r = dtm.fit_transform(pts)
+ assert len(w) == 2
+ for i in range(len(w)):
+ assert issubclass(w[i].category, RuntimeWarning)
+ assert "Overflow" in str(w[i].message)