unittest.TestCase.addTypeEqualityFunc()

addTypeEqualityFunc(typeobj, function)

Registers a type-specific method called by assertEqual() to check if two objects of exactly the same typeobj (not subclasses) compare equal. function must take two positional arguments and a third msg=None keyword argument just as assertEqual() does. It must raise self.failureException(msg) when inequality between the first two parameters is detected – possibly providing useful information and explaining the inequalities in details in the error message.

New in version 3.1.

doc_python
2016-10-07 17:46:17
Comments
Leave a Comment

Please login to continue.