chore: accept time argument in not_start mock of timer start#1350
chore: accept time argument in not_start mock of timer start#1350
time argument in not_start mock of timer start#1350Conversation
To improve readability of stactrace accept the time argument.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates a QTimer.start mock helper in tests so the File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughThe test configuration file is updated to modify a patching stub method. The Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- To make the mock more robust against future changes in
QTimer.start, consider matching its full signature (e.g., using*args, **kwargsor the exact parameter name and type) rather than only adding an optionaltime=Noneargument.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- To make the mock more robust against future changes in `QTimer.start`, consider matching its full signature (e.g., using `*args, **kwargs` or the exact parameter name and type) rather than only adding an optional `time=None` argument.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1350 +/- ##
===========================================
- Coverage 93.17% 93.15% -0.02%
===========================================
Files 210 210
Lines 33251 33251
===========================================
- Hits 30981 30976 -5
- Misses 2270 2275 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@package/tests/test_PartSeg/conftest.py`:
- Around line 93-94: The stub method not_start currently raises a RuntimeError
but its signature (self, time=None) triggers Ruff ARG001 for unused args; update
the not_start definition to either accept arbitrary args (def not_start(self,
*args, **kwargs):) or annotate the existing parameters with a noqa (e.g. def
not_start(self, time=None): # noqa: ARG001) and keep the RuntimeError,
referencing the not_start method to locate the change.
| def not_start(self, time=None): | ||
| raise RuntimeError("Thread should not be used in test") |
There was a problem hiding this comment.
Silence Ruff ARG001 for the unused stub parameters.
Ruff flags unused self and time here. Either ignore via # noqa: ARG001 or accept arbitrary args to keep lint clean.
💡 Minimal fix
- def not_start(self, time=None):
+ def not_start(*_, **__):
raise RuntimeError("Thread should not be used in test")🧰 Tools
🪛 Ruff (0.14.14)
[warning] 93-93: Unused function argument: self
(ARG001)
[warning] 93-93: Unused function argument: time
(ARG001)
[warning] 94-94: Avoid specifying long messages outside the exception class
(TRY003)
🤖 Prompt for AI Agents
In `@package/tests/test_PartSeg/conftest.py` around lines 93 - 94, The stub method
not_start currently raises a RuntimeError but its signature (self, time=None)
triggers Ruff ARG001 for unused args; update the not_start definition to either
accept arbitrary args (def not_start(self, *args, **kwargs):) or annotate the
existing parameters with a noqa (e.g. def not_start(self, time=None): # noqa:
ARG001) and keep the RuntimeError, referencing the not_start method to locate
the change.
time arguemt in not_start mock of timer starttime argumet in not_start mock of timer start
time argumet in not_start mock of timer starttime argument in not_start mock of timer start



To improve readability of the stack trace, accept the
timeargument.Summary by Sourcery
Tests:
Summary by CodeRabbit