From a151bc7d74e2ee9c621d8a8d80c13f7256254155 Mon Sep 17 00:00:00 2001 From: Ian Hincks Date: Fri, 2 Feb 2024 12:20:37 -0500 Subject: [PATCH] Skip Operator test is qiskit >=1.0 --- test/terra/primitives/test_estimator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/terra/primitives/test_estimator.py b/test/terra/primitives/test_estimator.py index dfd658e05c..7a357bd6d2 100644 --- a/test/terra/primitives/test_estimator.py +++ b/test/terra/primitives/test_estimator.py @@ -20,6 +20,7 @@ import numpy as np from ddt import data, ddt +import qiskit from qiskit.circuit import Parameter, QuantumCircuit from qiskit.circuit.library import RealAmplitudes from qiskit.exceptions import QiskitError @@ -84,6 +85,10 @@ def test_estimator(self, abelian_grouping): np.testing.assert_allclose(result.values, [-0.4], rtol=0.02) @data(True, False) + @unittest.skipUnless( + qiskit.__version__.startswith("0."), + reason="Operator support in primitives was removed following Qiskit 0.46", + ) def test_init_observable_from_operator(self, abelian_grouping): """test for evaluate without parameters""" circuit = self.ansatz.assign_parameters([0, 1, 1, 2, 3, 5])