From a70be33eea31333d3ef23f544955b59b44812b3f Mon Sep 17 00:00:00 2001 From: Antony Phillips Date: Tue, 8 Aug 2023 10:27:02 +0100 Subject: [PATCH] add test --- pulp/tests/test_pulp.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pulp/tests/test_pulp.py b/pulp/tests/test_pulp.py index 0ce442d7..d46c5d39 100644 --- a/pulp/tests/test_pulp.py +++ b/pulp/tests/test_pulp.py @@ -795,6 +795,27 @@ def test_pulp_123(self): else: pulpTestCheck(prob, self.solver, [const.LpStatusUnbounded]) + def test_msg_arg(self): + """ + Test setting the msg arg to True does not interfere with solve + """ + prob = LpProblem("test_msg_arg", const.LpMinimize) + x = LpVariable("x", 0, 4) + y = LpVariable("y", -1, 1) + z = LpVariable("z", 0) + w = LpVariable("w", 0) + prob += x + 4 * y + 9 * z, "obj" + prob += x + y <= 5, "c1" + prob += x + z >= 10, "c2" + prob += -y + z == 7, "c3" + prob += w >= 0, "c4" + data = prob.toDict() + var1, prob1 = LpProblem.fromDict(data) + x, y, z, w = (var1[name] for name in ["x", "y", "z", "w"]) + pulpTestCheck( + prob1, self.solver, [const.LpStatusOptimal], {x: 4, y: -1, z: 6, w: 0}, **{"msg": True} + ) + def test_pulpTestAll(self): """ Test the availability of the function pulpTestAll