Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential import error from test runner
Since Qiskit#3982 merged we've been using the python libraries fixtures and testtools to construct a custom test results handler that can handle attachments for parallel test execution. While this is only used by the test runner the imports could cause an issue for isntalled copies of terra trying to use the fake backends. Since the requirements-dev.txt isn't installed for regular installs if a user were to import the fake_backends with a plain install this would result in an ImportError because fixtures and/or testtools wasn't installed. Since these aren't really requirements for terra, and are only required to run tests this commit wraps the imports in a try block so no error will be raised unless it's actually a test run. At the same time fixtures and testtools are explicitly added to the requirements-dev.txt list. They are implicitly installed because they're requirements of stestr. But having them explicitly in the requirements-dev.txt list makes this dependency for running tests explicit, especially in cases where a user isn't using stestr as their test runner.
- Loading branch information