From: Ezio Melotti Date: Fri, 18 Nov 2011 16:59:36 +0000 (+0200) Subject: #13387: add note about checking the exact type in assertIsInstance doc. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa512f05a40774e0d6656d6bcafeaf3511dc039b;p=python #13387: add note about checking the exact type in assertIsInstance doc. --- diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 16a3a36695..3d8a84db38 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -895,6 +895,8 @@ Test cases Test that *obj* is (or is not) an instance of *cls* (which can be a class or a tuple of classes, as supported by :func:`isinstance`). + To check for a specific type (without including superclasses) use + :func:`assertIs(type(obj), cls) `. .. versionadded:: 2.7