ID EN
Unittest

assertIsInstance

Python 3.11

Test that obj is (or is not) an instance of cls (which can be a class or a tuple of classes, as supported by isinstance()). To check for the exact type, use assertIs(type(obj), cls).

Syntax

PYTHON
assertIsInstance(obj, cls, msg=None)

See Also

isinstance() assertIs(type(obj) cls)