-
Notifications
You must be signed in to change notification settings - Fork 238
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
Add SCIP solver for testing #1282
Conversation
idaes/core/util/testing.py
Outdated
|
||
def undo_changes(): | ||
try: | ||
os.environ["PATH"].remove(new_path_entry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ughhh, I just realized that this won't work since os.environ["PATH"] is a str rather than a list. Serves me right for trying to be smart and implement a way to revert global changes to the environment...
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1282 +/- ##
==========================================
+ Coverage 77.33% 77.40% +0.07%
==========================================
Files 390 390
Lines 63367 63388 +21
Branches 11648 11649 +1
==========================================
+ Hits 49006 49068 +62
+ Misses 11839 11796 -43
- Partials 2522 2524 +2 ☔ View full report in Codecov by Sentry. |
|
||
try: | ||
path_as_list.remove(new_path_entry) | ||
except ValueError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a bad idea to add a test to cover this case to future-proof against any changes in how AMPL and/or Python handle their PATH
entries / modifications in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it'd be nice to have the "undo" functionality tested. It's a bit tricky but I'll see what I can do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3de78e5
to
986ba84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @lbianchi-lbl ! Can I note how funny this name is, though? test for testing
;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noting, that was very much on purpose! I like to think of it as "Barber paradox for software engineers" 😅
Resolves #1281
Changes proposed in this PR:
ampl_module_scip
)scip_solver
pytest fixture for model diagnostics testsscip_solver
fixture (i.e. requires SCIP to run), it will be automatically skipped without the need of adding individualpytest.mark.skipif()
markers if SCIP is not availableampl_module_scip
from https://pypi.ampl.comLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: