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-Tag: v2.7.3rc1~292 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa512f05a40774e0d6656d6bcafeaf3511dc039b;p=thirdparty%2FPython%2Fcpython.git #13387: add note about checking the exact type in assertIsInstance doc. --- diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 16a3a36695d4..3d8a84db38e1 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