From 14b4bacd20a02aeebf2e56ddcc8a95182b19e953 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 16 Nov 2026 07:30:24 -0500 Subject: [PATCH] Remove unused Python state and Discord test helpers --- priv/python/albedo_cells.py | 4 +--- priv/python/albedo_discord.py | 4 ---- priv/python/albedo_quiescence.py | 2 -- test/e2e/discord_fake_support.py | 15 --------------- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/priv/python/albedo_cells.py b/priv/python/albedo_cells.py index cfc4cd868..b9f417ace 100644 --- a/priv/python/albedo_cells.py +++ b/priv/python/albedo_cells.py @@ -2958,9 +2958,7 @@ def main(): # Release eligibility is for the local owner; a remote kernel's stdio link # has nobody reading it, and the timer would wake it every second. if RUN_DIR is not None: - QUIESCENCE = albedo_quiescence.Quiescence( - LOOP, RESOURCE_OWNERS, link_resources, refresh_work - ) + QUIESCENCE = albedo_quiescence.Quiescence(LOOP, RESOURCE_OWNERS, link_resources) LOOP.call_soon(refresh_work) while not task.done(): try: diff --git a/priv/python/albedo_discord.py b/priv/python/albedo_discord.py index 250baaa7c..abfc06516 100644 --- a/priv/python/albedo_discord.py +++ b/priv/python/albedo_discord.py @@ -267,7 +267,6 @@ class Bot: self.fatal = False self.dm_channels: set[str] = set() self.people: dict[str, dict[str, Any]] = {} - self.ws: SimpleWebSocketClient | None = None # -- status --------------------------------------------------------- @@ -314,7 +313,6 @@ class Bot: ws = await SimpleWebSocketClient.connect( f"{base.rstrip('/')}/?v=10&encoding=json", proxy=self.proxy ) - self.ws = ws if await self.session(ws): backoff = BACKOFF_MIN except ConnectionClosed as closed: @@ -332,8 +330,6 @@ class Bot: return except (OSError, TimeoutError, ValueError, KeyError) as error: detail = f"{type(error).__name__}: {error}" - finally: - self.ws = None if self.fatal: return if detail: diff --git a/priv/python/albedo_quiescence.py b/priv/python/albedo_quiescence.py index f53b7988e..e861ebcbc 100644 --- a/priv/python/albedo_quiescence.py +++ b/priv/python/albedo_quiescence.py @@ -45,12 +45,10 @@ class Quiescence: loop: asyncio.AbstractEventLoop, owns: list[Callable[[], bool]], internal: Callable[[], tuple[set[threading.Thread], set[int]]], - monitor: Callable[[], None], ) -> None: self.loop = loop self.owns = owns self.internal = internal - self.monitor = monitor # the periodic sampler's own callback self.environment = environment_hash() self.threads = set(threading.enumerate()) initial = descriptors() diff --git a/test/e2e/discord_fake_support.py b/test/e2e/discord_fake_support.py index 1604f4005..4b7e8841b 100644 --- a/test/e2e/discord_fake_support.py +++ b/test/e2e/discord_fake_support.py @@ -269,18 +269,6 @@ class FakeDiscord: self._call(add) - def add_channel(self, guild_id: str, channel: dict[str, Any]) -> None: - """Add a channel or thread after connect (CHANNEL_CREATE / THREAD_CREATE).""" - - def add() -> None: - stored = self._store_channel(guild_id, channel, 0) - name = ( - "THREAD_CREATE" if stored["type"] in (10, 11, 12) else "CHANNEL_CREATE" - ) - self._dispatch(name, stored) - - self._call(add) - def _store_channel( self, guild_id: str, channel: dict[str, Any], position: int ) -> dict[str, Any]: @@ -511,9 +499,6 @@ class FakeDiscord: """Until a socket has identified or resumed and is receiving events.""" self.wait_for(self._live, timeout, "a live gateway socket") - def wait_for_identifies(self, count: int, timeout: float = 10) -> None: - self.wait_for(lambda: len(self.identifies) >= count, timeout, "IDENTIFY") - def wait_for_resumes(self, count: int, timeout: float = 10) -> None: self.wait_for(lambda: len(self.resumes) >= count, timeout, "RESUME") -- knotmirror 0.0.1