Skip to content

Make test_remote_policy.py self-contained#266

Merged
seanwevans merged 1 commit into
mainfrom
claude/remote-policy-test-isolation
Jul 20, 2026
Merged

Make test_remote_policy.py self-contained#266
seanwevans merged 1 commit into
mainfrom
claude/remote-policy-test-isolation

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Issue

pytest tests/test_remote_policy.py fails on current main when run as a standalone file: test_refresh_remote and test_refresh_remote_retries_on_timeout hit PolicyAuthError: invalid policy token. They only pass in the full suite because an earlier test file happens to leave the global supervisor's policy token set to "tok" — a hidden test-order dependency.

Fix

Add a policy_token fixture that sets the token via pyisolate.set_policy_token("tok") before each affected test and restores the previous value afterwards, so the file neither depends on nor leaks global token state.

Testing

  • pytest tests/test_remote_policy.py now passes standalone.
  • Full suite: 409 passed, 2 environment-gated skips; all pre-commit hooks pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DDSofWX5HwawsrwbN2nSXR


Generated by Claude Code

test_refresh_remote and test_refresh_remote_retries_on_timeout only
passed when an earlier test file had already set the global supervisor's
policy token to "tok"; running the file standalone failed with
PolicyAuthError. Add a fixture that sets the token and restores the
previous value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDSofWX5HwawsrwbN2nSXR
@seanwevans
seanwevans merged commit 429ce62 into main Jul 20, 2026
19 checks passed
@seanwevans
seanwevans deleted the claude/remote-policy-test-isolation branch July 20, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants