Skip to content

test: add tests for resolve_azure_model_name#244

Merged
gvanrossum merged 2 commits intomicrosoft:mainfrom
KRRT7:test/resolve-azure-model-name
Apr 23, 2026
Merged

test: add tests for resolve_azure_model_name#244
gvanrossum merged 2 commits intomicrosoft:mainfrom
KRRT7:test/resolve-azure-model-name

Conversation

@KRRT7
Copy link
Copy Markdown
Contributor

@KRRT7 KRRT7 commented Apr 23, 2026

Summary

  • Adds 3 tests for resolve_azure_model_name covering: deployment name extraction from endpoint, fallback to provided model name, and default AZURE_OPENAI_ENDPOINT envvar usage
  • Fixes test_create_embedding_model_uses_azure_deployment_name — wasn't clearing OPENAI_EMBEDDING_MODEL from the environment, so the assertion failed when that envvar was set
  • Addresses review comment from Fix endpoint parsing #241

Test plan

@KRRT7 KRRT7 force-pushed the test/resolve-azure-model-name branch from fb724c9 to 0d1f0df Compare April 23, 2026 08:25
The test expected DEFAULT_EMBEDDING_SPEC but OPENAI_EMBEDDING_MODEL in the
environment overrode it, causing a spurious failure.
Copy link
Copy Markdown
Collaborator

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. Though next time please don't include reformatting of unrelated lines -- it distracts the reviewer from the crux of the PR.

@gvanrossum gvanrossum merged commit bff2b34 into microsoft:main Apr 23, 2026
16 checks passed
gvanrossum pushed a commit that referenced this pull request Apr 23, 2026
## Summary
- Bumps `max_retries` from the default (2) to 5 across all four
`AsyncOpenAI`/`AsyncAzureOpenAI` construction sites
(`create_async_openai_client` and `_make_azure_provider`)
- The openai SDK's built-in exponential backoff handles transient 429s
automatically — this just gives it more attempts
- Three online tests (`test_ingest_podcast`, `test_query_method_basic`,
`test_transcript_knowledge_extraction_slow`) were failing intermittently
due to 429s

## Test plan
- [x] `make check` (pyright) — 0 errors
- [x] `pytest tests/test_model_adapters.py tests/test_utils.py` — 29/30
pass (1 pre-existing failure fixed in #244)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants