- self.assertFalse(callable(aval()),
- msg="Default value returned by function is callable")
+ default_value = aval()
+ self.assertFalse(callable(default_value),
+ msg=("Default value of %s.%s returned by function"
+ " is callable" % (cls.OP_ID, attr_name)))
+ else:
+ self.assertFalse(isinstance(aval, (list, dict, set)),
+ msg=("Default value of %s.%s is mutable (%s)" %
+ (cls.OP_ID, attr_name, repr(aval))))
+
+ default_value = aval
+
+ if aval is not ht.NoDefault and test is not ht.NoType:
+ self.assertTrue(test(default_value),
+ msg=("Default value of %s.%s does not verify" %
+ (cls.OP_ID, attr_name)))