-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PYTHON-3064 Add typings to test package #844
Changes from 17 commits
8627451
7ed5731
a385dff
d435dad
6009bf6
699e696
3f651f0
6247b9a
44607b7
d1b77b7
3c6ada0
887d804
d63bcc3
2b3796e
937a366
7ca474f
1f3a2aa
363c947
d12570e
1920c47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,8 @@ | |
|
||
import errno | ||
import select | ||
import socket | ||
import sys | ||
from typing import Any, Optional | ||
from typing import Any, Optional, Union | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Union is now unused. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
|
||
# PYTHON-2320: Jython does not fully support poll on SSL sockets, | ||
# https://bugs.jython.org/issue2900 | ||
|
@@ -43,7 +42,7 @@ def __init__(self) -> None: | |
else: | ||
self._poller = None | ||
|
||
def select(self, sock: Any, read: bool = False, write: bool = False, timeout: int = 0) -> bool: | ||
def select(self, sock: Any, read: bool = False, write: bool = False, timeout: Optional[Union[float, int]] = 0) -> bool: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. timeout should be float. The float type supports int automatically. Also is Optional needed? Do we ever pass None? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We call it with |
||
"""Select for reads or writes with a timeout in seconds (or None). | ||
|
||
Returns True if the socket is readable/writable, False on timeout. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
|
||
|
||
class TestAuthAWS(unittest.TestCase): | ||
uri: str | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
|
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.
Does it make sense to separate the test/ type checking so that we can globally ignore certain error codes in the test/ package? Eg:
Disabling some checks could make the tests easier to maintain.
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.
Done