Skip to content

Python enable arm operationtemplates tests - #11697

Merged
Yuchao Yan (msyyc) merged 3 commits into
mainfrom
python-enable-arm-operationtemplates-tests
Aug 17, 2026
Merged

Python enable arm operationtemplates tests#11697
Yuchao Yan (msyyc) merged 3 commits into
mainfrom
python-enable-arm-operationtemplates-tests

Conversation

@msyyc

Copy link
Copy Markdown
Contributor

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 323afb3

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR re-enables the Azure ARM operation-templates mock API tests (sync + async) in the @typespec/http-client-python package by removing the spec from the regeneration skip list and aligning CI pylint suppressions with the upstream configuration referenced in the PR description.

Changes:

  • Un-comment and enable sync/async pytest suites for Azure ARM operation templates.
  • Stop skipping the azure/resource-manager/operation-templates spec during regeneration.
  • Add a per-package pylint disable for the generated azure-resource-manager-operation-templates package and include a Chronus entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/http-client-python/tests/mock_api/azure/test_azure_arm_operationtemplates.py Enables sync ARM operation templates tests (needs a small iterator fix + boolean assertion style tweak).
packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_arm_operationtemplates_async.py Enables async ARM operation templates tests (boolean assertion style tweak).
packages/http-client-python/eng/scripts/ci/run_pylint.py Adds per-package pylint disable for too-many-statements for the operation templates generated package.
packages/http-client-python/eng/scripts/ci/regenerate-common.ts Removes operation-templates from SKIP_SPECS so it will be regenerated and tested.
.chronus/changes/python-enable-arm-operationtemplates-tests-2026-08-17.md Adds an internal changelog entry documenting the test enablement.
Suppressed comments (2)

packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_arm_operationtemplates_async.py:45

  • Avoid comparing booleans with == False; pylint commonly flags this and it can hide non-bool falsy values. Prefer is False (or assert not ... when appropriate).
    result = await client.check_name_availability.check_local(
        location="westus",
        body=models.CheckNameAvailabilityRequest(name="checkName", type="Microsoft.Web/site"),
    )
    assert result.name_available == False
    assert result.reason == models.CheckNameAvailabilityReason.ALREADY_EXISTS
    assert result.message == "Hostname 'checkName' already exists. Please select a different name."

packages/http-client-python/tests/mock_api/azure/test_azure_arm_operationtemplates.py:40

  • Avoid comparing booleans with == False; pylint commonly flags this and it can hide non-bool falsy values. Prefer is False (or assert not ... when appropriate).
    assert result.name_available == False

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Enable sync and async Azure ARM operation templates test coverage.

@azure-sdk-automation

azure-sdk-automation Bot commented Aug 17, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:c6b1685b1c412ef6e5f6a3a4b5eaec5e264a6565 vs this PR.

Diff summary: 49 file(s), +14451 / -0

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

Copilot AI review requested due to automatic review settings August 17, 2026 04:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/http-client-python/tests/mock_api/azure/test_azure_arm_operationtemplates.py:47

  • client.operations.list() returns an iterator/pager; calling .next() is not a valid Python 3 iteration pattern and is inconsistent with other ARM tests in this suite. Use next(iter(...)) (or materialize a list) so the test reliably retrieves the first item.
def test_operations_list(client):
    result = client.operations.list().next()
    assert result.name == "Microsoft.Compute/virtualMachines/write"

packages/http-client-python/tests/mock_api/azure/asynctests/test_azure_arm_operationtemplates_async.py:55

  • This test will pass vacuously if client.operations.list() yields no items because all assertions are inside the async for loop. Collect at least one item (as done in other async ARM tests) and assert the list is non-empty before validating fields.
async def test_operations_list(client):
    result = client.operations.list()
    async for operation in result:
        assert operation.name == "Microsoft.Compute/virtualMachines/write"
        assert operation.display.operation == "Create or Update Virtual Machine."
        assert operation.origin == "user,system"
        assert operation.action_type == "Internal"

@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Aug 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 17, 2026
@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit e5ccef6 Aug 17, 2026
43 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the python-enable-arm-operationtemplates-tests branch August 17, 2026 08:33
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.

3 participants