From fabf0275a91aeb84f4bca02906ee6f181abc0344 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Fri, 18 Nov 2011 18:59:36 +0200 Subject: [PATCH] #13387: add note about checking the exact type in assertIsInstance doc. --- Doc/library/unittest.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 32f66feef2..990bd4853f 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 -- 2.40.0