Skip TestJupyter tests if ibmq provider is not installed#3845
Merged
Conversation
The tests in test.python.tools.jupyter.TestJupyter rely on the ibmq provider for the execution of the notebooks. However we don't require the local installation (or the configuration) of the provider for running tests anywhere else. In cases where someone is missing either ibmq or credentials the tests (of which only test_jupyter_jobs_pbars) in the class will fail because they can't import qiskit.IBMQ. This commit addresses this issue by adding a skip to the class on hasattr(qiskit, 'IBMQ') so that if the ibmq provider is not installed the tests will all skip.
kdk
approved these changes
Feb 14, 2020
faisaldebouni
pushed a commit
to faisaldebouni/qiskit-terra
that referenced
this pull request
Aug 5, 2020
* Skip TestJupyter tests if ibmq provider is not installed The tests in test.python.tools.jupyter.TestJupyter rely on the ibmq provider for the execution of the notebooks. However we don't require the local installation (or the configuration) of the provider for running tests anywhere else. In cases where someone is missing either ibmq or credentials the tests (of which only test_jupyter_jobs_pbars) in the class will fail because they can't import qiskit.IBMQ. This commit addresses this issue by adding a skip to the class on hasattr(qiskit, 'IBMQ') so that if the ibmq provider is not installed the tests will all skip. * Disable broken lint rule Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The tests in test.python.tools.jupyter.TestJupyter rely on the ibmq
provider for the execution of the notebooks. However we don't require
the local installation (or the configuration) of the provider for
running tests anywhere else. In cases where someone is missing either
ibmq or credentials the tests (of which only test_jupyter_jobs_pbars) in
the class will fail because they can't import qiskit.IBMQ. This commit
addresses this issue by adding a skip to the class on
hasattr(qiskit, 'IBMQ') so that if the ibmq provider is not installed
the tests will all skip.
Details and comments