-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-115538: Emit warning when use bool as fd in _io.WindowsConsoleIO #116925
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add explicit tests for passing boolean to _WindowsConsoleIO constructor?
There are tests that pass 0 and 1 to _WindowsConsoleIO constructor in Lib/test/test_winconsoleio.py. You can add new tests for booleans there.
Thank you for the review, test case added. The |
Lib/test/test_winconsoleio.py
Outdated
with warnings.catch_warnings(): | ||
warnings.simplefilter("error", RuntimeWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be needed if assertRaises
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and found that these two lines are needed. However, I noticed that there is an assertWarns
function which does not require these two lines.
The original code is copied from existing codes, so maybe we should update them later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Uh oh!
There was an error while loading. Please reload this page.