This PR aims to reduce the amount of warnings generated by the API unit tests by fixing or selectively ignoring specific Decoy warnings.
Across the entire test suite, MissingSpecAttributeWarning has been suppressed. The purpose of this is to catch non-existent attributes of decoy mock objects, but it's being raised for any property that is referenced, which accounts for about 250 warnings. Ignoring these should not cause any issues because if a property is not being referred to properly, the vast majority of the time that will cause the test to fail anyway due to some rehearsal not occurring.
The other warning being suppressed is RedundantVerifyWarning for protocol_runner.py: test_load_json_runner, which cannot be fixed without harming the coverage of the test. Because there is a long explanation of why it is needed, I've chosen to simply ignore that for this specific test.
Otherwise I've fixed up a bunch of IncorrectCallWarning, RedundantVerifyWarning and MiscalledStubWarning throughout the unit tests.
There are still a few existing DeprecationWarnings and a bunch of RuntimeWarnings related to CanMessenger._read_task_shield' was never awaited but fixing those would involve more effort or changing packages/editing hardware code, so those have not been fixed.
Overall this reduces the amount of warnings from ~330 to ~40 warnings.
Changelog
fix/ignore Decoy warnings in api tests
Review requests
If anybody has an easy fix for any remaining errors, feel free to push it to this branch.
Overview
This PR aims to reduce the amount of warnings generated by the API unit tests by fixing or selectively ignoring specific Decoy warnings.
Across the entire test suite,
MissingSpecAttributeWarning
has been suppressed. The purpose of this is to catch non-existent attributes of decoy mock objects, but it's being raised for any property that is referenced, which accounts for about 250 warnings. Ignoring these should not cause any issues because if a property is not being referred to properly, the vast majority of the time that will cause the test to fail anyway due to some rehearsal not occurring.The other warning being suppressed is
RedundantVerifyWarning
forprotocol_runner.py: test_load_json_runner
, which cannot be fixed without harming the coverage of the test. Because there is a long explanation of why it is needed, I've chosen to simply ignore that for this specific test.Otherwise I've fixed up a bunch of
IncorrectCallWarning
,RedundantVerifyWarning
andMiscalledStubWarning
throughout the unit tests.There are still a few existing
DeprecationWarning
s and a bunch ofRuntimeWarning
s related toCanMessenger._read_task_shield' was never awaited
but fixing those would involve more effort or changing packages/editing hardware code, so those have not been fixed.Overall this reduces the amount of warnings from ~330 to ~40 warnings.
Changelog
Review requests
If anybody has an easy fix for any remaining errors, feel free to push it to this branch.
Risk assessment
Low