From 553d4787e012c40341ae6da899b6eaf46619559b Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Tue, 27 Aug 2024 09:07:25 +0100 Subject: [PATCH] tests: increase coverage --- tests/unit/test_optimisation.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/test_optimisation.py b/tests/unit/test_optimisation.py index fdd69903..994dedc3 100644 --- a/tests/unit/test_optimisation.py +++ b/tests/unit/test_optimisation.py @@ -421,6 +421,19 @@ def test_scipy_noprior(self, model, dataset): ): opt.run() + @pytest.mark.unit + def test_scipy_bounds(self, cost): + # Create the optimisation class with incorrect bounds type + with pytest.raises( + TypeError, + match="Bounds provided must be either type dict, list or SciPy.optimize.bounds object.", + ): + pybop.SciPyMinimize( + cost=cost, + bounds="This is a bad bound", + max_iterations=1, + ) + @pytest.mark.unit def test_halting(self, cost): # Test max evalutions