Skip to content

[python] Use specific exception types in status code range mock_api tests#10992

Merged
msyyc merged 2 commits into
mainfrom
fix-test-case-for-response-error
Jun 16, 2026
Merged

[python] Use specific exception types in status code range mock_api tests#10992
msyyc merged 2 commits into
mainfrom
fix-test-case-for-response-error

Conversation

@msyyc

@msyyc msyyc commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Use specific exception types in the status code range mock_api tests instead of the generic Exception, for both sync and async variants.

  • test_error_response_status_code_in_range now asserts on core_library.exceptions.HttpResponseError
  • test_error_response_status_code_404 now asserts on core_library.exceptions.ResourceNotFoundError
  • Applied consistently to both the sync test and its async counterpart

A changelog entry was added under .chronus/changes.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jun 16, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@10992

commit: 93720f0

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - internal ✏️

Use specific exception types in status code range mock_api tests for sync and async

@azure-sdk-automation

azure-sdk-automation Bot commented Jun 16, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@msyyc msyyc enabled auto-merge June 16, 2026 06:41
@msyyc msyyc added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@msyyc msyyc enabled auto-merge June 16, 2026 08:46
@msyyc msyyc added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit 68dd7b4 Jun 16, 2026
41 checks passed
@msyyc msyyc deleted the fix-test-case-for-response-error branch June 16, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants