From ffcc536fc4d5d5965560308e62dedad936b3997c Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 24 Sep 2026 14:21:41 +0530 Subject: [PATCH] test(auth): seed _persisted_token_pairs in the __new__ pool fixture The terminal-refresh visibility tests build CredentialPool via __new__ and hand-set its slots, bypassing __init__. Since _persist() now reads self._persisted_token_pairs directly (the getattr shim was dropped on purpose), the four cases that reach _persist raised AttributeError. Seed the attribute in the fixture like the other slots instead of restoring a defensive getattr in production code. --- tests/agent/test_credential_pool_terminal_refresh_visibility.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/agent/test_credential_pool_terminal_refresh_visibility.py b/tests/agent/test_credential_pool_terminal_refresh_visibility.py index 414595a947..8770edc8c5 100644 --- a/tests/agent/test_credential_pool_terminal_refresh_visibility.py +++ b/tests/agent/test_credential_pool_terminal_refresh_visibility.py @@ -30,6 +30,7 @@ def _pool(provider: str) -> CredentialPool: pool._current_id = None pool._max_concurrent = 2 pool._unmatched_rotation_streak = 0 + pool._persisted_token_pairs = {} pool.provider = provider return pool