def METHOD_NAME(self, weight, single_wires, msg_match):
    """Test that FermionicSingleExcitation throws an exception if ``weight`` or
    ``single_wires`` parameter has illegal shapes, types or values."""
    dev = qml.device("default.qubit", wires=5)
    def circuit(weight=weight):
        qml.FermionicSingleExcitation(weight=weight, wires=single_wires)
        return qml.expval(qml.PauliZ(0))
    qnode = qml.QNode(circuit, dev)
    with pytest.raises(ValueError, match=msg_match):
        qnode(weight=weight)