Skip to content

Commit

Permalink
Inherit markers from generate_test_description (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored Nov 16, 2022
1 parent 674de0d commit f142fd3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion launch_testing_ros/launch_testing_ros_pytest_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@
# importing downstream modules in upstream packages when built with a merged
# workspace.

import pytest


def pytest_launch_collect_makemodule(path, parent, entrypoint):
marks = getattr(entrypoint, 'pytestmark', [])
if marks and any(m.name == 'rostest' for m in marks):
from launch_testing_ros.pytest.hooks import LaunchROSTestModule
return LaunchROSTestModule.from_parent(parent=parent, fspath=path)
module = LaunchROSTestModule.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_configure(config):
Expand Down

0 comments on commit f142fd3

Please sign in to comment.