-
Couldn't load subscription status.
- Fork 40
Revert "fix(flightcontroller info): Revert tests that do pass, but break pylint in other files" #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…eak pylint in other files" This reverts commit fe3889f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reverts a previous commit that removed tests from the flight controller info test file. The revert restores approximately 560 lines of test code that were previously removed due to pylint issues in other files.
| ) | ||
|
|
||
| # pylint: disable=redefined-outer-name,protected-access | ||
| # pylint: disable=redefined-outer-name,protected-access,too-many-lines,unnecessary-dunder-call |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pylint disable comment includes 'unnecessary-dunder-call' which suggests the code contains direct calls to dunder methods like __setitem__. Consider refactoring to use proper interfaces instead of disabling this warning.
| # pylint: disable=redefined-outer-name,protected-access,too-many-lines,unnecessary-dunder-call | |
| # pylint: disable=redefined-outer-name,protected-access,too-many-lines |
| progress_bar_mock.__setitem__ = lambda _self, key, value: progress_bar_data.__setitem__(key, value) | ||
| progress_bar_mock.__getitem__ = lambda _self, key: progress_bar_data.__getitem__(key) |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct assignment to dunder methods creates unclear mock behavior. Consider using a proper mock configuration or a custom mock class that implements the dict interface naturally.
| progress_bar_mock.__setitem__ = lambda _self, key, value: progress_bar_data.__setitem__(key, value) | ||
| progress_bar_mock.__getitem__ = lambda _self, key: progress_bar_data.__getitem__(key) |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of the same dunder method assignment pattern. Consider creating a reusable helper function or fixture to avoid code duplication.
| progress_bar_mock.__setitem__ = lambda _self, key, value: progress_bar_data.__setitem__(key, value) | ||
| progress_bar_mock.__getitem__ = lambda _self, key: progress_bar_data.__getitem__(key) |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Third occurrence of the same dunder method assignment pattern. This code duplication should be refactored into a shared helper function.
| progress_bar_mock.__setitem__ = lambda _self, key, value: progress_bar_data.__setitem__(key, value) | ||
| progress_bar_mock.__getitem__ = lambda _self, key: progress_bar_data.get(key, 0) |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fourth occurrence of similar dunder method assignments. The inconsistent use of .get(key, 0) vs .__getitem__(key) suggests this pattern should be standardized in a helper function.
This reverts commit fe3889f.