Skip to content

Enable skipped Python SDK mock API tests after TCGC 0.67.0 upgrade#10302

Merged
msyyc merged 2 commits intomainfrom
copilot/enable-skipped-tests
Apr 9, 2026
Merged

Enable skipped Python SDK mock API tests after TCGC 0.67.0 upgrade#10302
msyyc merged 2 commits intomainfrom
copilot/enable-skipped-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Summary

Enable previously skipped Python SDK mock API tests and update them to match the current generated SDK API surface.

Changes

Client structure tests (8 tests: 4 sync + 4 async)

  • Removed @pytest.mark.skip decorator — the TCGC version requirement (≥ 0.67.0) is now met
  • Updated test code to match the new SDK API surface where operations are now accessed through operation groups:
    • RenamedOperationClient: client.renamed_two()client.group.renamed_two() (and similar for renamed_four, renamed_six)
    • TwoOperationGroupClient: client.one()client.group1.one(), client.two()client.group2.two() (etc.)
    • FirstClient: client.two()client.group3.two(), client.four()client.group4.four() (etc.)
    • SecondClient: client.six()client.group5.six()
  • Cleaned up unused import pytest statements

Spread record discriminated union tests (2 tests: 1 sync + 1 async)

  • Removed test_spread_record_discriminated_union test functions entirely since the Spector scenario (SpreadRecordForDiscriminatedUnion) was removed from @typespec/http-specs per PR #6425

Discriminated union tests (unchanged)

  • These remain skipped (@pytest.mark.skip) as the Python SDK generator doesn't yet support discriminated union serialization/deserialization

Validation

  • All client structure tests (12 total: sync + async) pass locally against the Spector mock server
  • All additional properties tests (62 total) pass after removing the obsolete test

…emove obsolete spread_record_discriminated_union tests

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/043fdd42-c357-4906-9025-d3b0605ba1c4

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@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 Apr 8, 2026
Copilot AI requested a review from msyyc April 8, 2026 09:04
Copilot finished work on behalf of msyyc April 8, 2026 09:04
@msyyc msyyc marked this pull request as ready for review April 8, 2026 09:18
@msyyc msyyc enabled auto-merge April 8, 2026 09:25
@azure-sdk
Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 8, 2026

Open in StackBlitz

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

commit: 8cb2070

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Enable previously skipped client structure and client operation group mock API tests after TCGC 0.67.0 upgrade; remove obsolete test_spread_record_discriminated_union tests whose Spector scenario was removed.

@msyyc msyyc added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit daa7f40 Apr 9, 2026
31 checks passed
@msyyc msyyc deleted the copilot/enable-skipped-tests branch April 9, 2026 01:05
msyyc added a commit that referenced this pull request Apr 9, 2026
…10302)

## Summary

Enable previously skipped Python SDK mock API tests and update them to
match the current generated SDK API surface.

## Changes

### Client structure tests (8 tests: 4 sync + 4 async)
- Removed `@pytest.mark.skip` decorator — the TCGC version requirement
(≥ 0.67.0) is now met
- Updated test code to match the new SDK API surface where operations
are now accessed through operation groups:
- `RenamedOperationClient`: `client.renamed_two()` →
`client.group.renamed_two()` (and similar for `renamed_four`,
`renamed_six`)
- `TwoOperationGroupClient`: `client.one()` → `client.group1.one()`,
`client.two()` → `client.group2.two()` (etc.)
- `FirstClient`: `client.two()` → `client.group3.two()`, `client.four()`
→ `client.group4.four()` (etc.)
  - `SecondClient`: `client.six()` → `client.group5.six()`
- Cleaned up unused `import pytest` statements

### Spread record discriminated union tests (2 tests: 1 sync + 1 async)
- Removed `test_spread_record_discriminated_union` test functions
entirely since the Spector scenario
(`SpreadRecordForDiscriminatedUnion`) was removed from
`@typespec/http-specs` per [PR
#6425](#6425)

### Discriminated union tests (unchanged)
- These remain skipped (`@pytest.mark.skip`) as the Python SDK generator
doesn't yet support discriminated union serialization/deserialization

## Validation
- All client structure tests (12 total: sync + async) pass locally
against the Spector mock server
- All additional properties tests (62 total) pass after removing the
obsolete test

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
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.

4 participants