unittest.TestCase.assertIsInstance()

assertIsInstance(obj, cls, msg=None) assertNotIsInstance(obj, cls, msg=None)

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).

New in version 3.2.

doc_python
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.