-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace assert
in tests with unittest methods
#10136
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5045808939
💛 - Coveralls |
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.
LGTM, I did not check extensively if there were other uses of assert outside of this PR, but I guess that we can open a new PR if we find them.
from scipy.optimize import rosen | ||
from qiskit.utils import algorithm_globals |
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.
These local imports looked strange to me too.
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 tidying this up. There's just one place where I think the new method isn't quite right, but other than that, looks good to me.
Co-authored-by: Jake Lishman <[email protected]>
* Replace `assert` with unittest methods * Update test/python/algorithms/optimizers/test_umda.py Co-authored-by: Jake Lishman <[email protected]> --------- Co-authored-by: Jake Lishman <[email protected]>
* Replace `assert` with unittest methods * Update test/python/algorithms/optimizers/test_umda.py Co-authored-by: Jake Lishman <[email protected]> --------- Co-authored-by: Jake Lishman <[email protected]>
* Replace `assert` with unittest methods * Update test/python/algorithms/optimizers/test_umda.py Co-authored-by: Jake Lishman <[email protected]> --------- Co-authored-by: Jake Lishman <[email protected]>
Summary
Mainly a follow-up to #8695, where we noticed some plain
assert
statements used instead of the appropriateunittest
methods. Also replaces those in some other tests and removes a dangling commentedassert
line.Details and comments