Remove unused args argument from main() in test fixtures - #400
Conversation
The main() functions in the client_service_node.py and pub_sub_node.py test fixtures accept an args parameter that is passed to rclpy.init(), but nothing ever calls main() with arguments. Drop the unused parameter so the signature is def main() and call rclpy.init() without args. Fixes ros2#398 Signed-off-by: mishra-prince <88850888+mishra-prince@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Removes unused args parameters from two standalone ROS 2 test fixtures.
Changes:
- Simplifies both
main()signatures. - Calls
rclpy.init()without unused arguments.
| File | Description |
|---|---|
sros2/test/sros2/commands/security/verbs/fixtures/pub_sub_node.py |
Removes the unused initialization argument. |
sros2/test/sros2/commands/security/verbs/fixtures/client_service_node.py |
Removes the unused initialization argument. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Pulls: #400 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rolling #400 +/- ##
========================================
Coverage 88.18% 88.18%
========================================
Files 18 18
Lines 601 601
Branches 53 53
========================================
Hits 530 530
Misses 52 52
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Fixes #398.
The
main()functions in two test fixtures accept anargsparameter that is forwarded torclpy.init(args=args), but nothing ever callsmain()with arguments. This removes the dead parameter so the signature isdef main()and callsrclpy.init()without args.Files changed:
sros2/test/sros2/commands/security/verbs/fixtures/client_service_node.pysros2/test/sros2/commands/security/verbs/fixtures/pub_sub_node.pyVerification
argstomain()(the fixtures are launched as standalone scripts via subprocess intest_generate_policy.pyand siblings, and__main__callsmain()with no arguments), so behavior is unchanged.python -m py_compilepasses on both files.Note: I was unable to run the full ament/ROS integration test suite locally as it requires a built ROS 2 workspace; CI should exercise it.
What this does not touch
No other files, no unrelated refactoring.