From 00a6952191fa0436514041039e58cba9324ab74f Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Sun, 5 Jul 2026 17:24:41 -0400 Subject: [PATCH] test(#5619): carry config path through quota helper state --- tests/test_provider_quota_status.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_provider_quota_status.py b/tests/test_provider_quota_status.py index 5da868189..1abbe941b 100644 --- a/tests/test_provider_quota_status.py +++ b/tests/test_provider_quota_status.py @@ -49,15 +49,18 @@ def _with_config(model=None, providers=None): except Exception: config._cfg_mtime = 0.0 config._cfg_path = config._get_config_path() - _restore_config._old_path = old_path - return old_cfg, old_mtime + return old_cfg, (old_mtime, old_path) def _restore_config(old_cfg, old_mtime): + if isinstance(old_mtime, tuple): + old_mtime, old_path = old_mtime + else: + old_path = getattr(config, "_cfg_path", None) config.cfg.clear() config.cfg.update(old_cfg) config._cfg_mtime = old_mtime - config._cfg_path = getattr(_restore_config, "_old_path", None) + config._cfg_path = old_path def test_openrouter_quota_fetches_key_endpoint_and_sanitizes_response(monkeypatch, tmp_path):