Skip to content

Commit

Permalink
Inherit markers from generate_test_description (ros2#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored Nov 16, 2022
1 parent 8869d81 commit 54fdda1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions launch_testing/launch_testing/pytest/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,14 @@ def pytest_launch_collect_makemodule(path, parent, entrypoint):
if marks and any(m.name == 'launch_test' for m in marks):
if _pytest_version_ge(7):
path = pathlib.Path(path)
return LaunchTestModule.from_parent(parent=parent, path=path)
module = LaunchTestModule.from_parent(parent=parent, path=path)
else:
return LaunchTestModule.from_parent(parent=parent, fspath=path)
module = LaunchTestModule.from_parent(parent=parent, fspath=path)
for mark in marks:
decorator = getattr(pytest.mark, mark.name)
decorator = decorator.with_args(*mark.args, **mark.kwargs)
module.add_marker(decorator)
return module


def pytest_addhooks(pluginmanager):
Expand Down

0 comments on commit 54fdda1

Please sign in to comment.