From c214c3b6053c76aa3ecc1357381aff4491ae78e7 Mon Sep 17 00:00:00 2001 From: albi3ro Date: Fri, 10 Sep 2021 15:43:12 +0100 Subject: [PATCH 1/3] allow device tests to run without specified shots --- .github/CHANGELOG.md | 2 ++ pennylane/devices/tests/test_measurements.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 222410636a0..a2bcf739da4 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -412,6 +412,8 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.

Bug fixes

+* The device suite tests can now execute successfully if no shots configuration variable is given. + * `MottonenStatepreparation` can now be run with a single wire label not in a list. [(#1620)](https://github.com/PennyLaneAI/pennylane/pull/1620) diff --git a/pennylane/devices/tests/test_measurements.py b/pennylane/devices/tests/test_measurements.py index 04255115457..a2744794b9f 100755 --- a/pennylane/devices/tests/test_measurements.py +++ b/pennylane/devices/tests/test_measurements.py @@ -66,7 +66,7 @@ def test_supported_observables_can_be_implemented(self, device_kwargs, observabl device_kwargs["wires"] = 3 dev = qml.device(**device_kwargs) - if device_kwargs["shots"] is not None and observable == "SparseHamiltonian": + if device_kwargs.get("shots", None) is not None and observable == "SparseHamiltonian": pytest.skip("SparseHamiltonian only supported in analytic mode") assert hasattr(dev, "observables") From d27e160d52aeda636ed28a77ede74048cd745d05 Mon Sep 17 00:00:00 2001 From: Christina Lee Date: Fri, 10 Sep 2021 15:46:01 +0100 Subject: [PATCH 2/3] Update .github/CHANGELOG.md --- .github/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a2bcf739da4..9b13674ab64 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -413,6 +413,7 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.

Bug fixes

* The device suite tests can now execute successfully if no shots configuration variable is given. + [(#1641)](https://github.com/PennyLaneAI/pennylane/pull/1641) * `MottonenStatepreparation` can now be run with a single wire label not in a list. [(#1620)](https://github.com/PennyLaneAI/pennylane/pull/1620) From c96ce08a23bede8056c1a3fcef9642d378472a74 Mon Sep 17 00:00:00 2001 From: albi3ro Date: Tue, 14 Sep 2021 10:04:18 +0100 Subject: [PATCH 3/3] move changelog entry --- .github/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 2f04abfd16f..43c292a3d97 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -47,6 +47,9 @@

Bug fixes

+* The device suite tests can now execute successfully if no shots configuration variable is given. + [(#1641)](https://github.com/PennyLaneAI/pennylane/pull/1641) +

Documentation

Contributors

@@ -482,9 +485,6 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.

Bug fixes

-* The device suite tests can now execute successfully if no shots configuration variable is given. - [(#1641)](https://github.com/PennyLaneAI/pennylane/pull/1641) - * `MottonenStatepreparation` can now be run with a single wire label not in a list. [(#1620)](https://github.com/PennyLaneAI/pennylane/pull/1620)