Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix running pyomo test-solvers #3432

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyomo/opt/plugins/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def setup_test_parser(parser):
def test_exec(options):
import pyomo.solvers.tests.testcases

pyomo.solvers.tests.testcases.run_test_scenarios(options)
pyomo.solvers.tests.testcases.run_scenarios(options)


#
Expand Down
6 changes: 3 additions & 3 deletions pyomo/solvers/tests/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def run_scenarios(options):

for key, test_case in generate_scenarios():
model, solver, io = key
if len(solvers) > 0 and not solver in solvers:
if len(solvers) > 0 and solver not in solvers:
continue
if test_case.status == 'skip':
continue
Expand All @@ -381,7 +381,7 @@ def run_scenarios(options):
# Validate solution status
try:
model_class.post_solve_test_validation(None, results)
except:
except Exception:
if test_case.status == 'expected failure':
stat[key] = (True, "Expected failure")
else:
Expand Down Expand Up @@ -431,7 +431,7 @@ def run_scenarios(options):
total = Bunch(NumEPass=0, NumEFail=0, NumUPass=0, NumUFail=0)
for key in stat:
model, solver, io = key
if not solver in summary:
if solver not in summary:
summary[solver] = Bunch(NumEPass=0, NumEFail=0, NumUPass=0, NumUFail=0)
_pass, _str = stat[key]
if _pass:
Expand Down
Loading