Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astralcai committed Sep 17, 2024
1 parent 9aa6d4e commit 13b655a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/gradients/core/test_adjoint_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
10 changes: 5 additions & 5 deletions tests/test_qnode_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 13b655a

Please sign in to comment.