From 2ddb0aa86e0b4dc6086366d9d6424cab32536e3e Mon Sep 17 00:00:00 2001 From: Nils Quetschlich Date: Wed, 27 Nov 2024 12:53:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20removed=20unnecessary=20exclusio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_benchmark_generation.py | 36 +++++++++++++----------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/test_benchmark_generation.py b/tests/test_benchmark_generation.py index 39a8afa4f..10b7606a7 100644 --- a/tests/test_benchmark_generation.py +++ b/tests/test_benchmark_generation.py @@ -18,7 +18,6 @@ from qiskit.qasm2 import LEGACY_CUSTOM_INSTRUCTIONS from qiskit.qasm2 import load as load_qasm2 from qiskit.qasm3 import load as load_qasm3 -from qiskit.qasm3.exceptions import QASM3ExporterError from mqt.bench import utils from mqt.bench.benchmark_generator import ( @@ -106,27 +105,22 @@ def test_quantumcircuit_alg_level( assert benchmark.__name__.split(".")[-1] in qc.name filename = "testfile" filepath = Path(output_path) / (filename + ".qasm") - if "ae" not in qc.name and "shor" not in qc.name: - res = qiskit_helper.get_alg_level(qc, input_value, False, False, output_path, filename) - assert res - assert load_qasm3(filepath) - - res = qiskit_helper.get_alg_level( - qc, - input_value, - file_precheck=True, - return_qc=False, - target_directory=output_path, - target_filename=filename, - qasm_format="qasm3", - ) - assert res - assert load_qasm3(filepath) - filepath.unlink() + res = qiskit_helper.get_alg_level(qc, input_value, False, False, output_path, filename) + assert res + assert load_qasm3(filepath) - else: - with pytest.raises(QASM3ExporterError, match="non-unitary subroutine calls are not yet supported"): - qiskit_helper.get_alg_level(qc, input_value, False, False, output_path, filename) + res = qiskit_helper.get_alg_level( + qc, + input_value, + file_precheck=True, + return_qc=False, + target_directory=output_path, + target_filename=filename, + qasm_format="qasm3", + ) + assert res + assert load_qasm3(filepath) + filepath.unlink() with pytest.raises( ValueError, match="'qasm2' is not supported for the algorithm level, please use 'qasm3' instead."