ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
126 stars 141 forks source link

:man_farmer: Windows test regressions, deprecated: `fspath argument for Node constructors replaced with pathlib.Path` #590

Closed Blast545 closed 2 years ago

Blast545 commented 2 years ago

Bug report

Required Info:

Steps to reproduce issue

Run a buildfarm windows job with rclpy and pytest version 7.

Expected behavior

All rclpy tests pass.

Actual behavior

Literally all fail, with this deprecation warning: https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path

Additional information

First time it happened on each buildfarm: https://ci.ros2.org/view/nightly/job/nightly_win_rel/2203/ https://ci.ros2.org/view/nightly/job/nightly_win_deb/2258/

The reason behind this problem is that currently pytest==7.0.0 is being used instead of pytest==6.2.5 and the fspath argument is deprecated now.

sloretz commented 2 years ago

Traceback seems to be in launch_testing

C:\Python38\lib\site-packages\pluggy\_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
C:\Python38\lib\site-packages\pluggy\_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
C:\Python38\lib\site-packages\_pytest\python.py:206: in pytest_collect_file
    module: Module = ihook.pytest_pycollect_makemodule(
C:\Python38\lib\site-packages\_pytest\config\compat.py:67: in fixed_hook
    return hook(**kw)
C:\Python38\lib\site-packages\pluggy\_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
C:\Python38\lib\site-packages\pluggy\_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
..\..\install\Lib\site-packages\launch_testing\pytest\hooks.py:173: in pytest_pycollect_makemodule
    return pytest.Package.from_parent(parent, fspath=path)
C:\Python38\lib\site-packages\_pytest\nodes.py:633: in from_parent
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
C:\Python38\lib\site-packages\_pytest\nodes.py:264: in from_parent
    return cls._create(parent=parent, **kw)
C:\Python38\lib\site-packages\_pytest\nodes.py:140: in _create
    return super().__call__(*k, **kw)
C:\Python38\lib\site-packages\_pytest\python.py:657: in __init__
    nodes.FSCollector.__init__(
C:\Python38\lib\site-packages\_pytest\nodes.py:588: in __init__
    path = _imply_path(type(self), path, fspath=fspath)
C:\Python38\lib\site-packages\_pytest\nodes.py:110: in _imply_path
    warnings.warn(
E   pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to Package is deprecated. Please use the (path: pathlib.Path) argument instead.
E   See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
clalancette commented 2 years ago

591 should fix this