Skip to content

azdev test: cap pytest below 9.2 for pytest-forked compatibility - #560

Merged
Cooper Cox (coopercox-ms) merged 1 commit into
Azure:devfrom
coopercox-ms:users/coopercox/pin-pytest-below-9.2
Nov 3, 2026
Merged

Cooper Cox (coopercox-ms) merged 1 commit into
Azure:devfrom
coopercox-ms:users/coopercox/pin-pytest-below-9.2

Conversation

@coopercox-ms

Copy link
Copy Markdown
Member

Related command

azdev test

Description

Problem. Since pytest 9.2.0 was published (27 Oct), azdev test fails every test on Linux and macOS with "running the test EXITED with status 3". The required Azure.azdev-cli check fails this way in the three "Test azdev test" jobs (azdev test redis): on dev since build 367005, the first run after the release, and on unrelated PRs such as #559.

Cause. On POSIX, azdev test always passes --forked (azdev/operations/testtool/pytest_runner.py). pytest-forked 1.7.5, the latest release, can't serialise pytest 9.2 reports (pytest-dev/pytest-forked#113, still open), so every forked test fails. azdev requires pytest>=5.0.0 with no upper bound, so a fresh install gets 9.2.0.

Fix. Cap pytest below 9.2 in azdev's own dependencies until pytest-forked supports it. It's a package dependency rather than a CI-only constraint because anyone who installs azdev and runs azdev test hits this. Azure/azure-cli and Azure/azure-cli-extensions (Azure/azure-cli-extensions#10535) already cap pytest<9.2 in their CI constraints for the same reason.

Evidence.

  • python -m build and twine check pass. The wheel and sdist declare Requires-Dist: pytest<9.2,>=5.0.0.
  • Resolving from PyPI: azdev 0.2.13 gets pytest 9.2.0; this branch's wheel and sdist get 9.1.1.
  • The CI job reproduced on Linux (WSL, Python 3.12): install the wheel, azdev setup -c -r, then azdev test redis. pytest stays at 9.1.1 after setup, and all 20 redis tests pass. Installing pytest 9.2.0 in the same environment brings back "EXITED with status 3". Both runs use the same pytest -x -v --forked ... -n auto command.

This unblocks dev CI and #559.


This checklist is used to make sure that common guidelines for a pull request are followed.

  • pylint azdev --rcfile=.pylintrc -r n

  • flake8 --statistics --append-config=.flake8 azdev

@x-engineering-agent

Copy link
Copy Markdown

Hi Cooper Cox (@coopercox-ms),
Please write the description of change into HISTORY.rst.
If you want to release a new azdev version, please update the VERSION in init.py as well.

@coopercox-ms
Cooper Cox (coopercox-ms) merged commit 8dcde01 into Azure:dev Nov 3, 2026
32 checks passed
@coopercox-ms
Cooper Cox (coopercox-ms) deleted the users/coopercox/pin-pytest-below-9.2 branch November 3, 2026 03:15
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