diff --git a/tests/gradients/core/test_adjoint_diff.py b/tests/gradients/core/test_adjoint_diff.py index ab38694ef72..d064fafe192 100644 --- a/tests/gradients/core/test_adjoint_diff.py +++ b/tests/gradients/core/test_adjoint_diff.py @@ -44,7 +44,7 @@ def test_not_expval(self, dev): def test_finite_shots_warns(self): """Tests warning raised when finite shots specified""" - dev = DefaultQubitLegacy(wires=2) + dev = DefaultQubitLegacy(wires=2, shots=10) with qml.queuing.AnnotatedQueue() as q: qml.expval(qml.PauliZ(0)) diff --git a/tests/test_qnode_legacy.py b/tests/test_qnode_legacy.py index 7399088fcb2..c27e2d8519f 100644 --- a/tests/test_qnode_legacy.py +++ b/tests/test_qnode_legacy.py @@ -396,13 +396,12 @@ def circuit(params): circuit(qml.numpy.array(0.1, requires_grad=True)) def test_not_giving_mode_kwarg_does_not_raise_warning(self): - """Test that not providing a value for mode does not raise a warning - except for the deprecation warning.""" + """Test that not providing a value for mode does not raise a warning.""" + with warnings.catch_warnings(record=True) as record: qml.QNode(lambda f: f, qml.device("default.mixed", wires=1)) - assert len(record) == 1 - assert record[0].category == qml.PennyLaneDeprecationWarning + assert len(record) == 0 class TestTapeConstruction: @@ -1468,7 +1467,8 @@ class TestTapeExpansion: ) def test_device_expansion(self, diff_method, mode, mocker): """Test expansion of an unsupported operation on the device""" - dev = qml.device("default.mixed", wires=1) + + dev = DefaultQubitLegacy(wires=1) # pylint: disable=too-few-public-methods class UnsupportedOp(qml.operation.Operation):