thermalctld: fix test warnings - #694
Open
fraserg-arista wants to merge 1 commit into
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the test code by removing Python 2 compatibility support and consolidating duplicate mock implementations.
- Removes deprecated
imp.load_sourcein favor ofimportlib(Python 3.12+ compatible) - Eliminates Python 2/3 conditional imports for the
mockmodule - Consolidates duplicate mock code by moving it to a shared location
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sonic-thermalctld/tests/test_thermalctld.py | Removes Python 2 compatibility code and replaces deprecated imp.load_source with modern importlib implementation |
| sonic-thermalctld/tests/mocked_libs/swsscommon/swsscommon.py | Adds missing constants and getKeys() method to the shared mock implementation |
| sonic-thermalctld/tests/mock_swsscommon.py | Consolidates duplicate code by importing from the shared mock library instead of duplicating class definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vvolam
reviewed
Oct 31, 2025
Add a missing method, remove duplicate code, remove a deprecated import. Signed-off-by: Fraser Gordon <fraserg@arista.com>
fraserg-arista
force-pushed
the
master-thermalctld-test-warnings
branch
from
February 18, 2026 21:07
3bfbb2e to
0d14e06
Compare
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
Fixes exceptions which produce warnings (and harm test coverage) when running thermalctld tests.
How Has This Been Tested?
Ran thermalctld tests, observed no more warnings.