Skip to content

Commit cd446f8

Browse files
committed
Fix issue when decorator does not have any arguments
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent 9ca6abd commit cd446f8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

launch_testing/launch_testing/pytest/fixture.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def event_loop():
6565
return event_loop
6666

6767

68-
def fixture(*args, **kwargs):
68+
def fixture(decorated = None, *args, **kwargs):
6969
"""
7070
Decorate launch_test fixtures.
7171
@@ -98,4 +98,6 @@ def fixture(*args, **kwargs):
9898
def decorator(fixture_function):
9999
fixture_function._launch_pytest_fixture = True
100100
return pytest.fixture(fixture_function, *args, **kwargs)
101-
return decorator
101+
if decorated is None:
102+
return decorator
103+
return decorator(decorated)

launch_testing/test/launch_testing/new_hooks/test_function_scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def order():
2323
return []
2424

2525

26-
@launch_testing.pytest.fixture()
26+
@launch_testing.pytest.fixture
2727
def launch_description():
2828
return launch.LaunchDescription([
2929
launch_testing.util.KeepAliveProc(),

0 commit comments

Comments
 (0)