Move QiskitTestCase to qiskit.test #1616
Merged
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
Move the basis classes and utilities for the unitests (
QiskitTestCase
, the decorators, and the related functionality) toqiskit.test
, taking the chance to add some tweaks:test/python/common.py
into several files, to reduce its size and make the new module more manageable.JobTestCase
to ibmq, as it was the only place where it was used.qasms
, for consistency.assertDictAlmostEqual
, shortening the method.This hopefully paves the way towards allowing third-party implementations to reuse parts of our framework, and eventually allow us to define some sort of "canonical" tests should we want to. The most likely short-term benefit will be for the providers outside the repo, and also prepares for #1389 and other efforts (for example, documentation for the base clases can be included in the Sphinx autodocs).
Details and comments
Note that in the PR,
test/python/common.py
remains as basically a thin layer that imports fromqiskit.test
- this was mostly done to avoid touching all the test files (which should be done eventually in another PR).