Skip to content

hotfix: pin pytest below 9.2 in the test requirements (0.20.10) - #434

Open
JohnYanxinLiu wants to merge 1 commit into
mainfrom
hotfix/pin-pytest-below-9-2
Open

JohnYanxinLiu wants to merge 1 commit into
mainfrom
hotfix/pin-pytest-below-9-2

Conversation

@JohnYanxinLiu

Copy link
Copy Markdown
Collaborator

Summary

Pins pytest below 9.2 in tests/requirements.txt (VERSION → 0.20.10). tests/requirements.txt installs pytest unpinned, and pytest 9.2.0 stops at collection in tests/harness/collection.py:168 before any test runs. The "Python unit and harness contracts" check therefore fails on every pull request, and /pytest runs stop the same way.

  • Cause. modify_items in collection.py sets item._nodeid, which 9.2.0 no longer has. From the unit check of hotfix: pin MAVROS to 2.14.0 in the robot and GCS images (0.20.9) #433 (run 43959101341), which installed pytest 9.2.0:

    File ".../tests/conftest.py", line 242, in pytest_collection_modifyitems
      collection.modify_items(items)
    File ".../tests/harness/collection.py", line 168, in modify_items
      item._nodeid = item._nodeid.replace(f"[{cs.id}]", f"[{new_id}]")
    AttributeError: 'Function' object has no attribute '_nodeid'. Did you mean: 'nodeid'?
    
  • When. The last green unit run (2026-09-11, run 34567644887) used pytest 9.1.1.

  • Fix. pytest → pytest<9.2 in tests/requirements.txt, and a dated 0.20.10 section in the release notes. collection.py is not changed. The main → develop sync brings the pin into develop, which has the same line and the same unpinned pytest.

Testing

The unit check on this PR installs from tests/requirements.txt on GitHub-hosted ubuntu-latest, so its result is the test. The "Run Tests" system-test job needs a self-hosted runner and is not part of it.

Follow-up

Make collection.py work with pytest 9.2 and later, then remove the pin.

🤖 Generated with Claude Code

pytest 9.2.0 stops at collection with an INTERNALERROR in
tests/harness/collection.py:168, so the Python unit and harness contracts
check failed on every pull request. Install pytest<9.2 until collection.py
works with 9.2 and later.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant