-
Notifications
You must be signed in to change notification settings - Fork 36
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
test: Mock only service call in AHS device initialization #229
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #229 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 1185 1185
Branches 286 286
=========================================
Hits 1185 1185 ☔ View full report in Codecov by Sentry. |
Why not include this in #850? The change doesn't make sense on its own. |
@speller26 I didn't see a way for a PR to make changes in two different repository? Is there a better way than having two separate PRs? |
Oops, thought this one was also in the SDK; in that case we'll just hold off until that PR is finalized. In the meantime, the prefix of the PR should be test: rather than fix: |
The fact that we need to add the field here before we merge the SDK change indicates a problem with how our mocks are set up; we shouldn't have to add in a yet-to-be-introduced property here |
yes, it's related to this mock. It should mock the individual attributes, instead of filling in what's necessary to a Mock. |
Instead of adding a amazon-braket-pennylane-plugin-python/test/unit_tests/test_ahs_device.py Lines 236 to 237 in 8c6fd32
with m.setattr(AwsDevice, "_get_session_and_initialize", lambda self, *args, **kwargs: MockAwsSession) Instead of mocking out the entirety of |
Great, this solution is working! I also tested locally that amazon-braket/amazon-braket-sdk-python#850 will pass with this fix. |
Description of changes:
Add noise model to mock aws device in unit test. This is an update for introducing BDK PR amazon-braket/amazon-braket-sdk-python#850
Testing done:
tox
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.