-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_typing
has strange assertIsInstance
calls
#111126
Labels
Comments
sobolevn
added
type-bug
An unexpected behavior, bug, or error
tests
Tests in the Lib/test dir
topic-typing
labels
Oct 20, 2023
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Oct 20, 2023
…n `test_typing`
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 20, 2023
…in `test_typing` (pythonGH-111127) (cherry picked from commit ea7c26e) Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 20, 2023
…in `test_typing` (pythonGH-111127) (cherry picked from commit ea7c26e) Co-authored-by: Nikita Sobolev <[email protected]>
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
…in `test_typing` (python#111127)
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…in `test_typing` (python#111127)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug report
These line are problematic:
cpython/Lib/test/test_typing.py
Lines 2013 to 2020 in 264f4af
Why?
self.assertIsInstance
gives the intention that this will returnTrue
self.assertNotIsInstance
gives the intention that this will returnFalse
self.assert[Not]IsInstance
can raiseTypeError
on its own (but not in practice)However, this will always fail with
TypeError
.I propose to use just
isintance
instead.Linked PRs
isinstance
instead ofassert[Not]IsInstance
intest_typing
#111127isinstance
instead ofassert[Not]IsInstance
intest_typing
(GH-111127) #111130isinstance
instead ofassert[Not]IsInstance
intest_typing
(GH-111127) #111131The text was updated successfully, but these errors were encountered: