Skip to content

{Packaging} pytest version restricted- #10534 - #10535

Merged
mansoor sarfraz (msarfraz) merged 1 commit into
Azure:mainfrom
msarfraz:pytest-version-fix
Oct 29, 2026
Merged

mansoor sarfraz (msarfraz) merged 1 commit into
Azure:mainfrom
msarfraz:pytest-version-fix

Conversation

@msarfraz

@msarfraz mansoor sarfraz (msarfraz) commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Suppressions
️✔️ None ️✔️ None

Background
The Azure CLI Extensions unit tests are failing
Root Cause
The failures are caused by an incompatibility between pytest 9.2.0 and pytest-forked 1.7.5,
What breaks

  1. Pytest 9.2.0, released October 27, changed report internals. Test reports now store a structured NodeId object in id, rather than storing only the string nodeid. This is documented in pytest’s release notes.
  2. pytest-forked copies the report’s internal dictionary and serializes it using marshal.dumps. The new NodeId object cannot be marshalled, causing ValueError: unmarshallable object.
  3. The plugin catches that exception and exits the child process with status 3 without printing the traceback. Consequently, even passing tests appear as failed subprocesses. See the relevant pytest-forked implementation.
    The installation logs explain why this appeared suddenly: azdev allows pytest>=5.0.0, so fresh environments automatically installed 9.2.0. Pinning the azdev Git commit does not pin its transitive dependencies.

Immediate Solution

constrain pytest to 9.1.1 or pytest<9.2. Apply a CI dependency constraint such as pytest<9.2 during installation, and retain it across subsequent dependency-installation steps.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 00:20

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.

🟢 Approval recommended

No active review issues were identified for the CI change that constrains pytest to avoid the reported pytest-forked incompatibility.

No open issues 🎉

What changed in this PR

This PR constrains pytest in Azure CLI Extensions CI to avoid the reported pytest 9.2 incompatibility with pytest-forked.

Changes:

  • Adds a shared dependency constraint requiring pytest<9.2.
  • Sets PIP_CONSTRAINT during azdev setup and persists it as a pipeline variable for subsequent installation steps.
File Description
.azure-pipelines/​templates/​azdev_setup.yml Applies and persists the pip constraint file path.
.azure-pipelines/​constraints.txt Defines the pytest version limit and documents its purpose.

Review effort: Balanced

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

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.

5 participants