-
Notifications
You must be signed in to change notification settings - Fork 192
[executor-preview] Tests for validation of NLV3 #2496
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
base: executor_preview
Are you sure you want to change the base?
Conversation
|
Ready for review. Note that the PR contains a bug fix. |
SamFerracin
left a comment
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! A couple of small comments
| configuration = BackendConfiguration( | ||
| backend_name="im_a_backend", | ||
| backend_version="0.0", | ||
| n_qubits=1e100, | ||
| basis_gates=["rx"], | ||
| gates=[], | ||
| local=False, | ||
| simulator=False, | ||
| conditional=True, | ||
| open_pulse=False, | ||
| memory=True, | ||
| coupling_map=[], | ||
| ) |
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.
Why not passing FakeAlgiers.configuration()?
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.
| with self.assertRaisesRegex(ValueError, "xslow"): | ||
| validate_options(options=options, configuration=configuration) | ||
|
|
||
| def test_validate_instruction(self): |
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.
This is a big test function with many assert. In general, I prefer breaking big test functions into many smaller test functions with asserts targeting a single concern, for example:
test_validate_instruction_passes_when_options_validtest_validate_instruction_without_twirl_raisestest_validate_instruction_without_box_raises- ...
The benefit is that if we make a change that invalidate one of these asserts, we immediately get a hint of what caused the break by reading the name(s) of the broken tests, as opposed to having to dig through
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.
Please check the solution of using subTest (2340427).
Co-authored-by: Samuele Ferracin <[email protected]>
Summary
Part of #2479.
Tests for the function in the file
qiskit_ibm_runtime/noise_learner_v3/validation.Details and comments