chore: smoke test fixes and code quality improvements (#88)
* fix: replace deprecated datetime.utcnow() and websockets.legacy APIs - Replace datetime.utcnow() with datetime.now(UTC) in Orderbook model - Use websockets.asyncio.client.connect instead of legacy websockets.connect - Import ConnectionClosed from websockets.exceptions directly - Update test mocks to patch the new import paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve ruff lint errors in alembic migration - Replace typing.Union with X | Y syntax (UP007) - Import Sequence from collections.abc instead of typing (UP035) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove deprecated version key from docker-compose.yml The top-level 'version' key is obsolete in modern Docker Compose and produces a warning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: fix README to match actual project structure and tooling - Replace pip commands with uv equivalents - Fix run command from 'python -m src.main' to 'python -m polymarket_insider_tracker' - Update project structure tree to reflect actual src/polymarket_insider_tracker/ layout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
7c494c38a6
commit
232680a760
@@ -231,7 +231,10 @@ class TestTradeStreamHandler:
|
||||
mock_ws = AsyncMock()
|
||||
mock_ws.send = AsyncMock()
|
||||
|
||||
with patch("websockets.connect", AsyncMock(return_value=mock_ws)):
|
||||
with patch(
|
||||
"polymarket_insider_tracker.ingestor.websocket.ws_connect",
|
||||
AsyncMock(return_value=mock_ws),
|
||||
):
|
||||
ws = await handler._connect()
|
||||
|
||||
assert ws is mock_ws
|
||||
@@ -333,7 +336,10 @@ class TestTradeStreamHandlerIntegration:
|
||||
|
||||
mock_ws = MockWebSocket(handler, trade_message)
|
||||
|
||||
with patch("websockets.connect", AsyncMock(return_value=mock_ws)):
|
||||
with patch(
|
||||
"polymarket_insider_tracker.ingestor.websocket.ws_connect",
|
||||
AsyncMock(return_value=mock_ws),
|
||||
):
|
||||
# Run with timeout to prevent hanging
|
||||
try:
|
||||
await asyncio.wait_for(handler.start(), timeout=1.0)
|
||||
|
||||
Reference in New Issue
Block a user