Skip to content

Migrate from mock to unittest.mock - #340

Merged
YonathanZetune merged 1 commit into
google:masterfrom
AleksMat:master
Nov 20, 2026
Merged

YonathanZetune merged 1 commit into
google:masterfrom
AleksMat:master

Conversation

@AleksMat

Copy link
Copy Markdown
Contributor

The Python standard library has included unittest.mock since Python 3.3, making the external mock backport package unnecessary.

Replace mock imports with from unittest import mock across the test suite, update direct patch calls to mock.patch for consistency, group and sort imports in the modified test files, and remove the mock dependency from setup.py and tox.ini.

The Python standard library has included `unittest.mock` since Python
3.3, making the external `mock` backport package unnecessary.

Replace `mock` imports with `from unittest import mock` across the test
suite, update direct `patch` calls to `mock.patch` for consistency,
group and sort imports in the modified test files, and remove the
`mock` dependency from `setup.py` and `tox.ini`.
@YonathanZetune
YonathanZetune self-requested a review November 20, 2026 19:18
@YonathanZetune
YonathanZetune merged commit c434fac into google:master Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants