fix: Clear restriction service singleton in o3-pro test setup
The test was failing when run in the full test suite because the ModelRestrictionService singleton persisted restrictions from previous tests. Specifically, test_fallback_with_shorthand_restrictions sets OPENAI_ALLOWED_MODELS="mini" which blocked o3-pro. Added utils.model_restrictions._restriction_service = None to ensure the test starts with clean restriction state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,11 @@ class TestO3ProOutputTextFix:
|
|||||||
|
|
||||||
def setup_method(self):
|
def setup_method(self):
|
||||||
"""Set up the test by ensuring clean registry state."""
|
"""Set up the test by ensuring clean registry state."""
|
||||||
|
# Clear the restriction service singleton to ensure clean state
|
||||||
|
import utils.model_restrictions
|
||||||
|
|
||||||
|
utils.model_restrictions._restriction_service = None
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user