Skip to content

Commit 09a83a0

Browse files
committed
Fix tests that were being missed
1 parent 168091b commit 09a83a0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/test_io.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def test_constraint_to_str(solver):
7575
)
7676

7777

78-
@pytest.mark.parametrize("use_var_names", [True, False])
7978
def test_write_lp(use_var_names, solver):
8079
if not solver.supports_write:
8180
pytest.skip(f"{solver.name} does not support writing LP files.")
@@ -93,8 +92,8 @@ def test_write_lp(use_var_names, solver):
9392
m.minimize = sum(cities[["country", "city", "rent"]] * m.population)
9493
m.total_pop = sum(m.population) >= 310
9594
m.capacity_constraint = m.population <= cities[["country", "city", "capacity"]]
96-
file_path = os.path.join(tmpdir, "test.lp")
9795

96+
file_path = os.path.join(tmpdir, "test.lp")
9897
m.write(file_path)
9998
m.optimize()
10099
obj_value = m.objective.value
@@ -109,7 +108,6 @@ def test_write_lp(use_var_names, solver):
109108
assert "population[CAN,Toronto]" not in f.read()
110109

111110

112-
@pytest.mark.parametrize("use_var_names", [True, False])
113111
def test_write_sol(use_var_names, solver):
114112
if not solver.supports_write:
115113
pytest.skip(f"{solver.name} does not support writing solution files.")

tests/test_solver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_retrieving_duals(solver):
2626
assert m.max_AB.dual == approx(0.1, **get_tol(solver))
2727
assert m.extra_slack_constraint.dual == approx(0, **get_tol(solver))
2828

29-
if solver == "gurobi":
29+
if solver.name == "gurobi":
3030
assert m.max_AB.attr.slack == approx(0, **get_tol(solver))
3131
assert m.extra_slack_constraint.attr.slack == approx(50, **get_tol(solver))
3232
assert m.A.attr.RC == approx(0, **get_tol(solver))
@@ -63,7 +63,7 @@ def test_retrieving_duals_vectorized(solver):
6363
**get_tol_pl(solver),
6464
)
6565

66-
if solver == "gurobi":
66+
if solver.name == "gurobi":
6767
assert_frame_equal(
6868
m.max_AB.attr.slack,
6969
pl.DataFrame({"c": [1, 2], "slack": [0, 50]}),
@@ -104,7 +104,7 @@ def test_support_variable_attributes(solver):
104104
**get_tol_pl(solver),
105105
)
106106

107-
if solver == "gurobi":
107+
if solver.name == "gurobi":
108108
assert_frame_equal(
109109
m.X.attr.RC,
110110
pl.DataFrame({"t": [1, 2], "RC": [0.0, 1.9]}),
@@ -154,7 +154,7 @@ def test_support_variable_raw_attributes(solver):
154154
**get_tol_pl(solver),
155155
)
156156

157-
if solver == "gurobi":
157+
if solver.name == "gurobi":
158158
assert_frame_equal(
159159
m.X.attr.RC,
160160
pl.DataFrame({"t": [1, 2], "RC": [0.0, 1.9]}),

0 commit comments

Comments
 (0)