Skip to content

Commit

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

(cherry picked from commit ea7c26e)

Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
sobolevn authored and miss-islington committed Oct 20, 2023
1 parent 7213fc2 commit 222989c
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 @@ -1944,13 +1944,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 222989c

Please sign in to comment.