ID EN
Unittest

addTypeEqualityFunc

Python 3.11

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.

Syntax

PYTHON
addTypeEqualityFunc(typeobj, function)

See Also

assertEqual() assertEqual() self.failureException(msg)