def METHOD_NAME(self):
    """Check that exceptions are thrown when setting bad parameters."""
    def setupProperty(property):
        bad_syn_spec = self.syn_spec.copy()
        bad_syn_spec.update(property)
        nest.Connect(self.pre_neuron, self.post_neuron, syn_spec=bad_syn_spec)
    def badPropertyWith(content, parameters):
        msg = "BadProperty(.+)" + content
        self.assertRaisesRegex(nest.kernel.NESTError, msg, setupProperty, parameters)
    badPropertyWith("Kplus", {"Kplus": -1.0})