From cabb1045d836cc89e3927931aa78402c10ba166a Mon Sep 17 00:00:00 2001 From: SoniaMazelet <121769948+SoniaMaz8@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:12:59 +0100 Subject: [PATCH] add test for max_iter --- test/test_solvers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test_solvers.py b/test/test_solvers.py index 05818d9b9..88970d9eb 100644 --- a/test/test_solvers.py +++ b/test/test_solvers.py @@ -184,6 +184,9 @@ def test_solve_last_step(): assert not torch.allclose(ga0 - ga0.mean(), ga - ga.mean()) assert not torch.allclose(gb0 - gb0.mean(), gb - gb.mean()) + with pytest.raises(ValueError): + ot.solve(M, a, b, grad="last_step", max_iter=0, reg=10) + @pytest.mark.skipif(not torch, reason="torch no installed") def test_solve_envelope():