Skip to content

Commit ee0322a

Browse files
committed
Forgot type and fix more type issues
1 parent 7e719a8 commit ee0322a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/trio/_tests/test_socket.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _frozenbind(
6666
flags: int = 0,
6767
) -> tuple[str | int | bytes | None, ...]:
6868
sig = inspect.signature(self._orig_getaddrinfo)
69-
bound = sig.bind(host, port, family, proto, flags)
69+
bound = sig.bind(host, port, family, type, proto, flags)
7070
bound.apply_defaults()
7171
frozenbound = bound.args
7272
assert not bound.kwargs
@@ -82,7 +82,9 @@ def set(
8282
proto: int = 0,
8383
flags: int = 0,
8484
) -> None:
85-
self._responses[self._frozenbind(host, port, family, proto, flags)] = response
85+
self._responses[self._frozenbind(host, port, family, type, proto, flags)] = (
86+
response
87+
)
8688

8789
def getaddrinfo(
8890
self,
@@ -93,12 +95,12 @@ def getaddrinfo(
9395
proto: int = 0,
9496
flags: int = 0,
9597
) -> GetAddrInfoResponse | str:
96-
bound = self._frozenbind(host, port, family, proto, flags)
98+
bound = self._frozenbind(host, port, family, type, proto, flags)
9799
self.record.append(bound)
98100
if bound in self._responses:
99101
return self._responses[bound]
100102
elif flags & stdlib_socket.AI_NUMERICHOST:
101-
return self._orig_getaddrinfo(host, port, family, proto, flags)
103+
return self._orig_getaddrinfo(host, port, family, type, proto, flags)
102104
else:
103105
raise RuntimeError(f"gai called with unexpected arguments {bound}")
104106

@@ -885,19 +887,17 @@ async def test_resolve_address_exception_in_connect_closes_socket() -> None:
885887
with tsocket.socket() as sock:
886888

887889
async def _resolve_address_nocp(
888-
self: _SocketType,
889-
host: str | bytes | None,
890-
port: str | bytes | int | None,
891-
family: int = 0,
892-
type: int = 0,
893-
proto: int = 0,
894-
flags: int = 0,
890+
address: AddressFormat,
891+
*,
892+
local: bool,
895893
) -> None:
894+
assert address == ""
895+
assert not local
896896
cancel_scope.cancel()
897897
await _core.checkpoint()
898898

899899
assert isinstance(sock, _SocketType)
900-
sock._resolve_address_nocp = _resolve_address_nocp # type: ignore[method-assign, assignment]
900+
sock._resolve_address_nocp = _resolve_address_nocp # type: ignore[method-assign]
901901
with assert_checkpoints():
902902
with pytest.raises(_core.Cancelled):
903903
await sock.connect("")

src/trio/_tests/test_testing_raisesgroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def test_RaisesGroup_matches() -> None:
236236
def test_message() -> None:
237237
def check_message(
238238
message: str,
239-
body: RaisesGroup[object],
239+
body: RaisesGroup[BaseException],
240240
) -> None:
241241
with pytest.raises(
242242
AssertionError,

0 commit comments

Comments
 (0)