chore: clean up tests from previous pr#687
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 15 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR consolidates and cleans up test files from PR #656. The main changes involve moving decoder/padding tests from a device-specific test file to a more general protocol test file, and improving logging test assertions in multiple test files.
- Tests for decoder padding behavior moved from
tests/devices/test_local_decoder_padding.pytotests/test_protocol.py - Improved logging test assertions by using
caplog.at_level()context manager and simplifying record filtering - Consolidated multiple test cases into a parametrized test for cleaner code organization
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_protocol.py | New file consolidating decoder padding tests with parametrization for different garbage byte scenarios |
| tests/devices/test_mqtt_channel.py | Improved logging test using caplog.at_level() context manager and simplified record filtering |
| tests/devices/test_local_decoder_padding.py | Deleted - tests moved to tests/test_protocol.py |
| tests/devices/test_local_channel.py | Added missing logging import and improved logging test pattern consistent with mqtt_channel changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @pytest.mark.parametrize( | ||
| ("garbage"), |
There was a problem hiding this comment.
The parametrize decorator has incorrect syntax. The first argument should be either a plain string "garbage" or a tuple with a trailing comma ("garbage",). Currently, ("garbage") without a trailing comma is just a string in parentheses, not a tuple. This should be changed to either:
- "garbage" (recommended for single parameter)
- ("garbage",) (tuple with trailing comma)
Clean up tests from review on #656