fix(deps+tests): move httpx to prod deps; stub Poller+Scheduler in sync test
httpx was in dev deps only, causing ImportError for users doing `pip install -e .` since atm.commands imports httpx at module level. Moved to main dependencies. Also stubs TelegramPoller and ScreenshotScheduler in the sync catchup test to prevent flaky CI failures from attempted real network connections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -229,6 +229,17 @@ def test_run_live_catchup_sell_from_gray_then_dark_red(monkeypatch, tmp_path):
|
||||
def step(self, *a, **kw):
|
||||
return types.SimpleNamespace(status="pending", levels=None)
|
||||
|
||||
class _StubPoller:
|
||||
def __init__(self, *a, **kw): pass
|
||||
async def run(self): await asyncio.sleep(9999)
|
||||
|
||||
class _StubScheduler:
|
||||
def __init__(self, *a, **kw):
|
||||
self.is_running = False
|
||||
def start(self, interval_s): self.is_running = True
|
||||
def stop(self): self.is_running = False
|
||||
async def run(self): await asyncio.sleep(9999)
|
||||
|
||||
monkeypatch.setattr("atm.detector.Detector", ScriptedDetector)
|
||||
monkeypatch.setattr("atm.canary.Canary", FakeCanary)
|
||||
monkeypatch.setattr("atm.notifier.fanout.FanoutNotifier", FakeFanout)
|
||||
@@ -238,6 +249,8 @@ def test_run_live_catchup_sell_from_gray_then_dark_red(monkeypatch, tmp_path):
|
||||
monkeypatch.setattr("atm.levels.LevelsExtractor", _Stub)
|
||||
monkeypatch.setattr("atm.main._build_capture", fake_build_capture)
|
||||
monkeypatch.setattr("atm.main.time.sleep", lambda s: None)
|
||||
monkeypatch.setattr("atm.commands.TelegramPoller", _StubPoller)
|
||||
monkeypatch.setattr("atm.scheduler.ScreenshotScheduler", _StubScheduler)
|
||||
|
||||
with pytest.raises(_StopLoop):
|
||||
_main.run_live(cfg, duration_s=None)
|
||||
|
||||
Reference in New Issue
Block a user