Skip to content

Commit

Permalink
Disable simulator tests so the stage1 of Travis can succeed.
Browse files Browse the repository at this point in the history
If the binary is not found, then the test will skip in stage1,
on later stages, there's a build step that will make travis fail
if something is wrong.
  • Loading branch information
atilag authored and chriseclectic committed Apr 13, 2018
1 parent c2b6142 commit ee08d1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions qiskit/backends/_qasm_simulator_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
DEFAULT_SIMULATOR_PATHS = [
# This is the path where Makefile creates the simulator by default
os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../out/src/qasm-simulator-cpp/qasm_simulator_cpp' + EXTENSION)),
'../../out/src/qasm-simulator-cpp/qasm_simulator_cpp'
+ EXTENSION)),
# This is the path where PIP installs the simulator
os.path.abspath(os.path.join(os.path.dirname(__file__),
'qasm_simulator_cpp' + EXTENSION)),
'qasm_simulator_cpp' + EXTENSION)),
]


Expand Down
6 changes: 5 additions & 1 deletion test/python/test_local_qasm_simulator_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def setUp(self):
backend='local_qiskit_simulator',
preformatted=True)
# Simulator backend
self.backend = QasmSimulatorCpp.QasmSimulatorCpp()
try:
self.backend = QasmSimulatorCpp.QasmSimulatorCpp()
except FileNotFoundError as fnferr:
raise unittest.SkipTest(
'cannot find {} in path'.format(fnferr))

def test_x90_coherent_error_matrix(self):
X90 = np.array([[1, -1j], [-1j, 1]]) / np.sqrt(2)
Expand Down

0 comments on commit ee08d1b

Please sign in to comment.