diff --git a/cirq-core/cirq/ops/boolean_hamiltonian_test.py b/cirq-core/cirq/ops/boolean_hamiltonian_test.py index 0110da86d29..a7c5c65eee7 100644 --- a/cirq-core/cirq/ops/boolean_hamiltonian_test.py +++ b/cirq-core/cirq/ops/boolean_hamiltonian_test.py @@ -128,9 +128,9 @@ def test_gray_code_sorting(n_bits, expected_hs): hs = hs_template.copy() random.shuffle(hs) - sorted_hs = sorted(list(hs), key=functools.cmp_to_key(bh._gray_code_comparator)) + sorted_hs = sorted(hs, key=functools.cmp_to_key(bh._gray_code_comparator)) - np.testing.assert_array_equal(sorted_hs, expected_hs) + assert sorted_hs == expected_hs @pytest.mark.parametrize( diff --git a/cirq-core/cirq/transformers/transformer_primitives_test.py b/cirq-core/cirq/transformers/transformer_primitives_test.py index 9c7a8c7c31f..92106f18c5e 100644 --- a/cirq-core/cirq/transformers/transformer_primitives_test.py +++ b/cirq-core/cirq/transformers/transformer_primitives_test.py @@ -333,7 +333,7 @@ def test_merge_operations_complexity(op_density): lambda _, __: None, lambda op1, _: op1, lambda _, op2: op2, - lambda op1, op2: prng.choice([op1, op2, None]), + lambda op1, op2: (op1, op2, None)[prng.choice(3)], ]: def wrapped_merge_func(op1, op2):