Skip to content

Commit f3324a6

Browse files
committed
Explicitly check that SinkhornL1l2Transport.fit works with no warnings
1 parent 9dd4d8d commit f3324a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_da.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import numpy as np
88
from numpy.testing import assert_allclose, assert_equal
99
import pytest
10+
import warnings
1011

1112
import ot
1213
from ot.datasets import make_data_classif
@@ -166,7 +167,9 @@ def test_sinkhorn_l1l2_transport_class(nx):
166167
otda = ot.da.SinkhornL1l2Transport()
167168

168169
# test its computed
169-
otda.fit(Xs=Xs, ys=ys, Xt=Xt)
170+
with warnings.catch_warnings():
171+
warnings.simplefilter("error")
172+
otda.fit(Xs=Xs, ys=ys, Xt=Xt)
170173
assert hasattr(otda, "cost_")
171174
assert hasattr(otda, "coupling_")
172175
assert hasattr(otda, "log_")

0 commit comments

Comments
 (0)