summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorarincbulgur <37184019+arincbulgur@users.noreply.github.com>2022-12-23 11:45:23 -0500
committerGitHub <noreply@github.com>2022-12-23 17:45:23 +0100
commit058d275565f0f65c23e06853812d5eb3a6ebdcef (patch)
tree669668c3df3f556f9af885f00f4bb2c81ccf4929 /test
parentc9578b4cc29b58d9cde9ff586870140021471fc1 (diff)
[MRG] Fix warning bug in sinkhorn2 (#417)
* Pass warn argument downstream in sinkhorn2 method. * releases.md * Fix unittest. Co-authored-by: RĂ©mi Flamary <remi.flamary@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_bregman.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_bregman.py b/test/test_bregman.py
index 0f47c3f..ce15642 100644
--- a/test/test_bregman.py
+++ b/test/test_bregman.py
@@ -7,6 +7,7 @@
#
# License: MIT License
+import warnings
from itertools import product
import numpy as np
@@ -58,7 +59,10 @@ def test_convergence_warning(method):
with pytest.warns(UserWarning):
ot.barycenter(A, M, 1, method=method, stopThr=0, numItermax=1)
with pytest.warns(UserWarning):
- ot.sinkhorn2(a1, a2, M, 1, method=method, stopThr=0, numItermax=1)
+ ot.sinkhorn2(a1, a2, M, 1, method=method, stopThr=0, numItermax=1, warn=True)
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
+ ot.sinkhorn2(a1, a2, M, 1, method=method, stopThr=0, numItermax=1, warn=False)
def test_not_implemented_method():