Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fabf027

Browse files
committed
#13387: add note about checking the exact type in assertIsInstance doc.
1 parent 7f78ddc commit fabf027

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/library/unittest.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ Test cases
929929

930930
Test that *obj* is (or is not) an instance of *cls* (which can be a
931931
class or a tuple of classes, as supported by :func:`isinstance`).
932+
To check for a specific type (without including superclasses) use
933+
:func:`assertIs(type(obj), cls) <assertIs>`.
932934

933935
.. versionadded:: 3.2
934936

0 commit comments

Comments
 (0)