Fix linting: use builtin OSError and TimeoutError instead of socket aliases
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user