Fix linting: use builtin OSError and TimeoutError instead of socket aliases
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 15s
CI / Test (push) Successful in 9s
CI / Release (push) Has been skipped

This commit is contained in:
2025-12-02 22:26:08 +00:00
parent 52ee76046e
commit 97107279b2
2 changed files with 7 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ class TestTCPTransport:
"""Test connection failure raises ConnectionError."""
mock_sock = MagicMock()
mock_socket_class.return_value = mock_sock
mock_sock.connect.side_effect = socket.error("Connection refused")
mock_sock.connect.side_effect = OSError("Connection refused")
with pytest.raises(ConnectionError, match="Failed to connect"):
transport.connect()
@@ -113,7 +113,7 @@ class TestTCPTransport:
"""Test write failure raises IOError."""
mock_sock = MagicMock()
mock_socket_class.return_value = mock_sock
mock_sock.sendall.side_effect = socket.error("Write failed")
mock_sock.sendall.side_effect = OSError("Write failed")
transport.connect()
@@ -167,7 +167,7 @@ class TestTCPTransport:
"""Test read timeout raises TimeoutError."""
mock_sock = MagicMock()
mock_socket_class.return_value = mock_sock
mock_sock.recv.side_effect = socket.timeout("Timed out")
mock_sock.recv.side_effect = TimeoutError("Timed out")
transport.connect()