]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 20 Oct 2023 18:28:41 +0000 (20:28 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Oct 2023 18:28:41 +0000 (18:28 +0000)
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (GH-111127)
(cherry picked from commit ea7c26e4b89c71234c4a603567a93f0a44c9cc97)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/test_typing.py

index 177155a636566278d3a0919ad08b261886c7cd41..fa279b557de2c65b633ff6723b55d7e75d4e2b27 100644 (file)
@@ -1944,13 +1944,13 @@ class BaseCallableTests:
         def f():
             pass
         with self.assertRaises(TypeError):
-            self.assertIsInstance(f, Callable[[], None])
+            isinstance(f, Callable[[], None])
         with self.assertRaises(TypeError):
-            self.assertIsInstance(f, Callable[[], Any])
+            isinstance(f, Callable[[], Any])
         with self.assertRaises(TypeError):
-            self.assertNotIsInstance(None, Callable[[], None])
+            isinstance(None, Callable[[], None])
         with self.assertRaises(TypeError):
-            self.assertNotIsInstance(None, Callable[[], Any])
+            isinstance(None, Callable[[], Any])
 
     def test_repr(self):
         Callable = self.Callable