@@ -818,13 +818,9 @@ def test_switch_model_re_resolves_context_window(self):
818818 p = os .path .join (d , "config.json" )
819819 with open (p , "w" , encoding = "utf-8" ) as f :
820820 f .write ('{"context_windows": {"deepseek-v4*": 1000000}}' )
821- client = Client (
822- base_url = "http://x/v1" , api_key = "k" , model = "gpt-5-mini" , config_path = p
823- )
821+ client = Client (base_url = "http://x/v1" , api_key = "k" , model = "gpt-5-mini" , config_path = p )
824822 self .addCleanup (client .close )
825- session = RecordingSession (
826- model_profiles = {"deepseek" : {"model" : "deepseek-v4-flash" }}
827- )
823+ session = RecordingSession (model_profiles = {"deepseek" : {"model" : "deepseek-v4-flash" }})
828824 session .client = client
829825 self .assertEqual (client .context_window , 128_000 )
830826 success , _ = session .switch_model ("deepseek" )
@@ -835,9 +831,7 @@ def test_switch_model_resets_calibrator(self):
835831 """Switching models must drop the token-calibration factor: it
836832 was tuned to the previous model's tokenizer and would skew the
837833 first context estimates for the new model."""
838- session = RecordingSession (
839- model_profiles = {"deepseek" : {"model" : "deepseek-v4-flash" }}
840- )
834+ session = RecordingSession (model_profiles = {"deepseek" : {"model" : "deepseek-v4-flash" }})
841835 session .calibrator .factor = 2.5
842836 session .calibrator .last_raw_estimate = 1234
843837 success , _ = session .switch_model ("deepseek" )
0 commit comments