fix: Clear restriction service in o3-pro test setup for proper isolation
The o3-pro test now clears the restriction service singleton in its setup_method to ensure it re-reads environment variables set by the @patch.dict decorator. This prevents cached restrictions from previous tests (like test_fallback_with_shorthand_restrictions) from blocking the o3-pro model. This is a minimal, targeted fix that only affects the specific test that needs it, without breaking other tests that may depend on the restriction service state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,12 @@ class TestO3ProOutputTextFix:
|
|||||||
# Use the new public API for registry cleanup
|
# Use the new public API for registry cleanup
|
||||||
ModelProviderRegistry.reset_for_testing()
|
ModelProviderRegistry.reset_for_testing()
|
||||||
# Provider registration is now handled by inject_transport helper
|
# Provider registration is now handled by inject_transport helper
|
||||||
|
|
||||||
|
# Clear restriction service to ensure it re-reads environment
|
||||||
|
# This is necessary because previous tests may have set restrictions
|
||||||
|
# that are cached in the singleton
|
||||||
|
import utils.model_restrictions
|
||||||
|
utils.model_restrictions._restriction_service = None
|
||||||
|
|
||||||
def teardown_method(self):
|
def teardown_method(self):
|
||||||
"""Clean up after test to ensure no state pollution."""
|
"""Clean up after test to ensure no state pollution."""
|
||||||
|
|||||||
Reference in New Issue
Block a user