Skip to content

Fix Pytest 8/9 compatibility in hooks#972

Merged
ahcorde merged 1 commit into
ros2:rollingfrom
mjcarroll:fix/pytest-compatibility
May 5, 2026
Merged

Fix Pytest 8/9 compatibility in hooks#972
ahcorde merged 1 commit into
ros2:rollingfrom
mjcarroll:fix/pytest-compatibility

Conversation

@mjcarroll

Copy link
Copy Markdown
Member

This PR fixes deprecated hook signatures in launch and launch_testing that cause failures in newer pytest versions (e.g. Pytest 9.0).

@mjcarroll

Copy link
Copy Markdown
Member Author

Pulls: #972
Gist: https://gist.githubusercontent.com/mjcarroll/ab068d35285c578a5071a28913f757a7/raw/e25c37ab94f65b7fda1ad47dc6248cb1d0431e10/ros2.repos
BUILD args: --packages-above-and-dependencies launch_pytest
TEST args: --packages-above launch_pytest
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19134

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

This commit addresses two issues:
1. Renames deprecated path argument to module_path/collection_path in pytest hooks to support Pytest 8/9.
2. Ensures LaunchService run_async task is always awaited by registering the finalizer earlier and passing the task explicitly.

Assisted-by: Gemini CLI:2.0-Flash [run_shell_command, replace, git, gh]
Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
@mjcarroll mjcarroll force-pushed the fix/pytest-compatibility branch from d86b699 to 6d7358b Compare May 5, 2026 01:16
@mjcarroll

Copy link
Copy Markdown
Member Author

Pulls: #972, ros2/launch_ros#540
Gist: https://gist.githubusercontent.com/mjcarroll/a83f4accadea98cbb9fae33c730cee5e/raw/69cbe18f7e422c86ee1438f9fdfb58463534f592/ros2.repos
BUILD args: --packages-above-and-dependencies launch_pytest
TEST args: --packages-above launch_pytest
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19137

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 0630831 into ros2:rolling May 5, 2026
3 checks passed
@ahcorde

ahcorde commented May 5, 2026

Copy link
Copy Markdown
Contributor

https://github.com/Mergifyio backport lyrical

@mergify

mergify Bot commented May 5, 2026

Copy link
Copy Markdown

backport lyrical

✅ Backports have been created

Details

@mjcarroll mjcarroll deleted the fix/pytest-compatibility branch May 5, 2026 11:43
mjcarroll added a commit to mjcarroll/launch that referenced this pull request May 7, 2026
…s2#972)

This commit addresses two issues:
1. Renames deprecated path argument to module_path/collection_path in pytest hooks to support Pytest 8/9.
2. Ensures LaunchService run_async task is always awaited by registering the finalizer earlier and passing the task explicitly.

Assisted-by: Gemini CLI:2.0-Flash [run_shell_command, replace, git, gh]

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
clalancette added a commit that referenced this pull request May 8, 2026
* Fix Pytest 8/9 compatibility and coroutine leaks in launch_pytest (#972)

This commit addresses two issues:
1. Renames deprecated path argument to module_path/collection_path in pytest hooks to support Pytest 8/9.
2. Ensures LaunchService run_async task is always awaited by registering the finalizer earlier and passing the task explicitly.

Assisted-by: Gemini CLI:2.0-Flash [run_shell_command, replace, git, gh]

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
(cherry picked from commit 0630831)

* Robust pytest_ignore_collect for multi-version Pytest compatibility (#974)

* Robust Pytest 7/8/9 compatibility and collection fixes

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>

* Robust Pytest 7/8/9 compatibility and collection fixes

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>

* More fixes (hopefully working this time).

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

---------

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>

---------

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Michael Carroll <mjcarroll.oss@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Owen-Liuyuxuan pushed a commit to tier4/launch that referenced this pull request Jun 11, 2026
* fix regressions (ros2#959)

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* Fix test_io_tests for Ubuntu26 (ros2#960)

* fix test_io_tests

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* Fix other test case

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

---------

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* Correct typos (ros2#961)

Signed-off-by: augustelalande <auguste.lalande@gmail.com>

* Changelog

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>

* 3.9.7

* Fix Pytest 8/9 compatibility and coroutine leaks in launch_pytest (ros2#972)

This commit addresses two issues:
1. Renames deprecated path argument to module_path/collection_path in pytest hooks to support Pytest 8/9.
2. Ensures LaunchService run_async task is always awaited by registering the finalizer earlier and passing the task explicitly.

Assisted-by: Gemini CLI:2.0-Flash [run_shell_command, replace, git, gh]

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>

* Robust pytest_ignore_collect for multi-version Pytest compatibility (ros2#974)

* Robust Pytest 7/8/9 compatibility and collection fixes

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>

* Robust Pytest 7/8/9 compatibility and collection fixes

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>

* More fixes (hopefully working this time).

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

---------

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>

* changelogs

Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>

* 3.10.0

---------

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: augustelalande <auguste.lalande@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
Co-authored-by: Michael Carlstrom <rmc@carlstrom.com>
Co-authored-by: Auguste Lalande <auguste.lalande@gmail.com>
Co-authored-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Michael Carroll <mjcarroll.oss@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Shane Loretz <sloretz@intrinsic.ai>
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