Skip to content

Add few more return-type annotations to tests #7331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cirq-core/cirq/contrib/qasm_import/_parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def test_two_qubit_gates(qasm_gate: str, cirq_gate: cirq.testing.TwoQubitGate) -
)
def test_two_qubit_param_gates(
qasm_gate: str, cirq_gate: cirq.testing.TwoQubitGate, num_params: int
):
) -> None:
params = '(0.1, 0.2, 0.3)' if num_params == 3 else '(0.1)'
qasm = f"""
OPENQASM 2.0;
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/testing/random_circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_random_circuit(
op_density: float,
gate_domain: Optional[Dict[cirq.Gate, int]],
pass_qubits: bool,
):
) -> None:
qubit_set = cirq.LineQubit.range(n_qubits)
qubit_arg = qubit_set if pass_qubits else n_qubits
circuit = cirq.testing.random_circuit(qubit_arg, n_moments, op_density, gate_domain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def assert_ops_implement_unitary(q0, q1, operations, intended_effect, atol=0.01)
)
def test_two_to_ops_equivalent_and_bounded_for_known_and_random(
max_partial_cz_depth, max_full_cz_depth, effect
):
) -> None:
q0 = cirq.NamedQubit('q0')
q1 = cirq.NamedQubit('q1')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_decompose_xx_yy_into_two_fsims_ignoring_single_qubit_ops_fail() -> None
@pytest.mark.parametrize('obj,fsim_gate', itertools.product(UNITARY_OBJS, FEASIBLE_FSIM_GATES))
def test_decompose_two_qubit_interaction_into_four_fsim_gates_equivalence(
obj: Any, fsim_gate: cirq.FSimGate
):
) -> None:
qubits = obj.qubits if isinstance(obj, cirq.Operation) else cirq.LineQubit.range(2)
circuit = cirq.decompose_two_qubit_interaction_into_four_fsim_gates(obj, fsim_gate=fsim_gate)
desired_unitary = obj if isinstance(obj, np.ndarray) else cirq.unitary(obj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test_small_circuit_on_ring_device() -> None:
)
def test_random_circuits_grid_device(
qubits: int, n_moments: int, op_density: float, random_state: int
):
) -> None:
c_orig = cirq.testing.random_circuit(
qubits=qubits, n_moments=n_moments, op_density=op_density, random_state=random_state
)
Expand All @@ -176,7 +176,7 @@ def test_random_circuits_grid_device(
)
def test_large_random_circuits_grid_device(
qubits: int, n_moments: int, op_density: float, random_state: int
):
) -> None:
c_orig = cirq.testing.random_circuit(
qubits=qubits, n_moments=n_moments, op_density=op_density, random_state=random_state
)
Expand Down