def test_incompatible_m_value_and_qubit_args(m: int, n: int) -> None:
    r"""The code checks that test errors are raised if the arguments m (number of
    superposition states and n (number of qubits) are positive integers and are compatible
     (i.e., n >= log2(m)).
    """

    if not (isinstance(m, int)):
        with pytest.raises(ValueError, match="m_value must be a positive integer."):
            cirq.UniformSuperpositionGate(m, n)
    elif not (isinstance(n, int)):
        with pytest.raises(
            ValueError,
            match="num_qubits must be an integer greater than or equal to log2\\(m_value\\).",
        ):
            cirq.UniformSuperpositionGate(m, n)
    elif m < 1:
        with pytest.raises(ValueError, match="m_value must be a positive integer."):
            cirq.UniformSuperpositionGate(int(m), int(n))
    elif n < np.log2(m):
        with pytest.raises(
            ValueError,
            match="num_qubits must be an integer greater than or equal to log2\\(m_value\\).",
        ):
            cirq.UniformSuperpositionGate(m, n)
The code checks that test errors are raised if the arguments m (number of
    superposition states and n (number of qubits) are positive integers and are compatible
     (i.e., n >= log2(m)).
    
cirq-core/cirq/ops/uniform_superposition_gate_test.py