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:
Josh Vera
2025-07-13 10:08:05 -06:00
parent 1b09238c7a
commit 538ac55880

View File

@@ -34,6 +34,11 @@ class TestO3ProOutputTextFix:
def setup_method(self):
"""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
ModelProviderRegistry.reset_for_testing()
# Provider registration is now handled by inject_transport helper