diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a270746022..d607381fde 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -13,11 +13,14 @@ ### Bug fixes +* Test updates to reflect new measurement error messages. +[(#334)](https://github.com/PennyLaneAI/pennylane-lightning/pull/334) + ### Contributors This release contains contributions from (in alphabetical order): -Amintor Dusko +Amintor Dusko, Chae-Yeun Park --- diff --git a/pennylane_lightning/_version.py b/pennylane_lightning/_version.py index dde0b381dc..ebd6a29d33 100644 --- a/pennylane_lightning/_version.py +++ b/pennylane_lightning/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.26.0-dev1" +__version__ = "0.26.0-dev2" diff --git a/tests/test_measures.py b/tests/test_measures.py index 0492200c17..8df8864b40 100644 --- a/tests/test_measures.py +++ b/tests/test_measures.py @@ -248,9 +248,9 @@ def test_not_an_observable(self, dev): @qml.qnode(dev) def circuit(): qml.RX(0.52, wires=0) - return qml.expval(qml.CNOT(wires=[0, 1])) + return qml.expval(qml.RX(0.742, wires=[0])) - with pytest.raises(qml.QuantumFunctionError, match="CNOT is not an observable"): + with pytest.raises(qml._device.DeviceError, match="Observable RX not supported"): circuit() def test_observable_return_type_is_expectation(self, dev): @@ -348,10 +348,10 @@ def test_not_an_observable(self, dev): @qml.qnode(dev) def circuit(): qml.RX(0.52, wires=0) - return qml.var(qml.CNOT(wires=[0, 1])) + return qml.var(qml.RX(0.742, wires=[0])) - with pytest.raises(qml.QuantumFunctionError, match="CNOT is not an observable"): - res = circuit() + with pytest.raises(qml._device.DeviceError, match="Observable RX not supported"): + circuit() def test_observable_return_type_is_variance(self, dev): """Test that the return type of the observable is :attr:`ObservableReturnTypes.Variance`""" @@ -377,9 +377,9 @@ def test_not_an_observable(self, stat_func): @qml.qnode(dev) def circuit(): qml.RX(0.52, wires=0) - return stat_func(qml.CNOT(wires=[0, 1])) + return qml.var(qml.RX(0.742, wires=[0])) - with pytest.raises(qml.QuantumFunctionError, match="CNOT is not an observable"): + with pytest.raises(qml._device.DeviceError, match="Observable RX not supported"): circuit()