Use stdlib unittest.mock#1074
Open
gotmax23 wants to merge 2 commits into
Open
Conversation
It is recommended to use unittest.mock from the standard library instead of the mock backport package which shouldn't be necessary with modern Python versions.
gotmax23
requested review from
Krunal-Thakkar,
MangirishK,
Saksham-Nautiyal,
ShrinidhiRao15,
rounak-adhikary,
subrahmanyam-a and
trisha-dell
as code owners
February 10, 2026 19:57
Collaborator
|
Can one of the admins verify this patch? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## collections #1074 +/- ##
===============================================
- Coverage 93.54% 93.54% -0.01%
===============================================
Files 296 296
Lines 46333 46332 -1
Branches 4220 4220
===============================================
- Hits 43340 43339 -1
Misses 1909 1909
Partials 1084 1084 ☔ View full report in Codecov by Sentry. |
rounak-adhikary
approved these changes
Feb 12, 2026
rounak-adhikary
left a comment
Contributor
There was a problem hiding this comment.
LGTM since GHAs are passing.
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
It is recommended to use unittest.mock from the standard library instead of the mock backport package which shouldn't be necessary with modern Python versions. It especially shouldn't be necessary to import both packages in the same file.
Downstreams like Fedora Linux are planning to remove the standalone mock package from the distribution (https://fedoraproject.org/wiki/Changes/DeprecatePythonMock) for this reason.
GitHub Issues
List the GitHub issues impacted by this PR:
ISSUE TYPE
COMPONENT NAME
test
OUTPUT
ADDITIONAL INFORMATION
Checklist: