Skip to content

Commit

Permalink
[3.12] pythongh-111126: Use isinstance instead of `assert[Not]IsIns…
Browse files Browse the repository at this point in the history
…tance` in `test_typing` (pythonGH-111127) (python#111130)

pythongh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (pythonGH-111127)
(cherry picked from commit ea7c26e)

Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
miss-islington and sobolevn authored Oct 20, 2023
1 parent dfc8d7a commit 4a10260
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2011,13 +2011,13 @@ def test_callable_instance_type_error(self):
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
Expand Down

0 comments on commit 4a10260

Please sign in to comment.