Persist manual requests until exchange confirmation, preserve stop protection, and reconcile fills before settling plans. Tighten model stream, crawler, skill, research accounting, and frontend race handling, with regression coverage. Keep queued analyses pending until a fresh account snapshot is available.
15 lines
552 B
Python
15 lines
552 B
Python
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def trading(monkeypatch):
|
|
# 测试只替换 I/O 边界,不读取项目凭证,也不连接线上数据库或 Redis。
|
|
for key, value in {
|
|
"DATABASE_URL": "postgresql+asyncpg://test:[email protected]/test",
|
|
"REDIS_URL": "redis://127.0.0.1:1/0", "JWT_SECRET": "test-only",
|
|
"ADMIN_USERNAME": "test", "SECRET_ENCRYPTION_KEY": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
|
|
}.items():
|
|
monkeypatch.setenv(key, value)
|
|
from alphapulse.trading import executor
|
|
return executor
|