File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 88from qiskit import QuantumCircuit
99from qiskit_aer import AerSimulator
1010
11+
1112class MockCompiler :
1213 def __init__ (self , pattern ):
1314 self ._pattern = pattern
@@ -20,6 +21,7 @@ def compile(self, save_statevector: bool):
2021 circ_output = [],
2122 )
2223
24+
2325def test_compile_with_default_options (monkeypatch ):
2426 monkeypatch .setattr ("graphix_ibmq.backend.IBMQPatternCompiler" , MockCompiler )
2527 backend = IBMQBackend ()
@@ -54,9 +56,7 @@ def test_set_hardware(monkeypatch):
5456 mock_backend_obj .name = "mock_hardware_backend"
5557 mock_service_instance .backend .return_value = mock_backend_obj
5658
57- monkeypatch .setattr (
58- "graphix_ibmq.backend.QiskitRuntimeService" , lambda : mock_service_instance
59- )
59+ monkeypatch .setattr ("graphix_ibmq.backend.QiskitRuntimeService" , lambda : mock_service_instance )
6060
6161 backend .set_hardware (name = "mock_hardware_backend" )
6262
@@ -69,8 +69,8 @@ def test_submit_job_without_backend_configured():
6969 dummy_compiled_circuit = IBMQCompiledCircuit (
7070 circuit = QuantumCircuit (1 ), pattern = object (), register_dict = {}, circ_output = []
7171 )
72-
72+
7373 with pytest .raises (RuntimeError ) as exc_info :
7474 backend .submit_job (dummy_compiled_circuit )
75-
75+
7676 assert "Backend not set" in str (exc_info .value )
You can’t perform that action at this time.
0 commit comments