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: v3.2.3rc1~379 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fabf0275a91aeb84f4bca02906ee6f181abc0344;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 32f66feef2b3..990bd4853f6b 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -929,6 +929,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:: 3.2