refactor: simplify dynamic provider settings tests

maintainer edit: keep the WebUI dynamic-provider behavior unchanged while reducing repeated test setup and tightening the small dynamic-provider helper.
This commit is contained in:
chengyongru
2026-06-13 00:04:13 +08:00
committed by Xubin Ren
parent 37ae655fa6
commit 57ced7930d
2 changed files with 49 additions and 66 deletions
+5 -5
View File
@@ -334,11 +334,11 @@ def _provider_configured_for_settings(spec: Any, provider_config: Any) -> bool:
def _dynamic_provider_items(config: Any) -> list[tuple[str, ProviderConfig]]:
items: list[tuple[str, ProviderConfig]] = []
for name, provider_config in (config.providers.model_extra or {}).items():
if isinstance(provider_config, ProviderConfig):
items.append((name, provider_config))
return items
return [
(name, provider_config)
for name, provider_config in (config.providers.model_extra or {}).items()
if isinstance(provider_config, ProviderConfig)
]
def _resolve_settings_provider(