test(agent): isolate anthropic oauth setup token from macos keychain - #58419
fyzanshaik wants to merge 1 commit into
Conversation
c156f12 to
77579b2
Compare
|
Thanks for the focused test-isolation fix. No blocking problems found.
This is an automated hermes-sweeper review. |
|
Thanks @fyzanshaik — closing as resolved on main: the suite-wide autouse _neutralize_macos_keychain_creds guard from PR #74517 (via #35464) covers the anthropic oauth setup tests. Earliest credit on the keychain-mock class goes to #35093 (May 30). Verified post-merge (84/84 adapter tests green). |
Fixes #58415
The setup-token tests mock
subprocess.runto cover theclaude setup-tokensubprocess. On macOS, credential resolution also shells out throughsubprocess.runto read Claude Code credentials from Keychain, so those tests were feeding the Claude CLI MagicMock into the Keychain JSON parser.This keeps the setup-token seam focused by stubbing the Keychain credential reader to return
Nonefor theTestRunOauthSetupTokenclass. File credentials and env-var fallbacks remain exercised, but macOS Keychain subprocess behavior is tested independently.Tests:
scripts/run_tests.sh tests/agent/test_anthropic_adapter.py