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

Ignore local testing warnings when testing with fake backend #1333

Merged
merged 1 commit into from
May 9, 2024

Conversation

frankharkins
Copy link
Member

When we use the fake backend to test code examples, we can get the following warnings (example).

Cell 24:
 │ /home/runner/work/documentation/documentation/.tox/py3/lib/python3.9/site-
 │ packages/qiskit_ibm_runtime/session.py:157: UserWarning: Session is not
 │ supported in local testing mode or when using a simulator.
 │   warnings.warn(

Cell 28:
 │ /home/runner/work/documentation/documentation/.tox/py3/lib/python3.9/site-
 │ packages/qiskit_ibm_runtime/fake_provider/local_service.py:243:
 │ UserWarning: Options {'default_shots': 10000, 'dynamical_decoupling':
 │ {'enable': True}} have no effect in local testing mode.
 │   warnings.warn(f"Options {options_copy} have no effect in local testing
 │ mode.")

This PR ignores those specific warnings when the patch is enabled so they don't break CI.

@frankharkins frankharkins requested a review from Eric-Arellano May 9, 2024 10:39
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

@frankharkins frankharkins added this pull request to the merge queue May 9, 2024
Merged via the queue into main with commit 1c8cc5f May 9, 2024
2 checks passed
@frankharkins frankharkins deleted the FH/ignore-local-testing-warnings branch May 9, 2024 14:21
frankharkins added a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
…1333)

When we use the fake backend to test code examples, we can get the
following warnings
([example](https://github.com/Qiskit/documentation/actions/runs/8991252592/job/24698420154?pr=1307#step:7:74)).

```
Cell 24:
 │ /home/runner/work/documentation/documentation/.tox/py3/lib/python3.9/site-
 │ packages/qiskit_ibm_runtime/session.py:157: UserWarning: Session is not
 │ supported in local testing mode or when using a simulator.
 │   warnings.warn(

Cell 28:
 │ /home/runner/work/documentation/documentation/.tox/py3/lib/python3.9/site-
 │ packages/qiskit_ibm_runtime/fake_provider/local_service.py:243:
 │ UserWarning: Options {'default_shots': 10000, 'dynamical_decoupling':
 │ {'enable': True}} have no effect in local testing mode.
 │   warnings.warn(f"Options {options_copy} have no effect in local testing
 │ mode.")
 ```

 This PR ignores those specific warnings when the patch is enabled so they don't break CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants