def testConstraintArg(self):
    constraint = (lambda x: x)
    v = variables.Variable((lambda : constant_op.constant(1.0)), constraint=constraint)
    self.assertEqual(v.constraint, constraint)
    constraint = 0
    with self.assertRaises(ValueError):
        v = variables.Variable((lambda : constant_op.constant(1.0)), constraint=constraint)
def testConstraintArg(self):
    constraint = (lambda x: x)
    v = variables.Variable((lambda : constant_op.constant(1.0)), constraint=constraint)
    self.assertEqual(v.constraint, constraint)
    constraint = 0
    with self.assertRaises(ValueError):
        v = variables.Variable((lambda : constant_op.constant(1.0)), constraint=constraint)