Skip to content

Conversation

@a-detiste
Copy link

mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.

https://github.com/testing-cabal/mock

@a-detiste a-detiste requested review from a team as code owners June 30, 2025 02:16
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jun 30, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 30, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2025
@musicinmybrain
Copy link

See also #1361, #1055.

@chalmerlowe chalmerlowe self-assigned this Dec 22, 2025
@chalmerlowe chalmerlowe added the kokoro:run Add this label to force Kokoro to re-run the tests. label Dec 22, 2025
@chalmerlowe chalmerlowe requested a review from a team as a code owner December 22, 2025 18:09
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Dec 22, 2025
@chalmerlowe chalmerlowe changed the title remove use of old external "mock" module chore: remove use of old external "mock" module Dec 22, 2025
@chalmerlowe
Copy link
Contributor

Made multiple updates to account for:

  • incorrectly spelled library names
  • adjust the order of certain imports to align with flake8 guidelines for imports

@chalmerlowe chalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 26, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Dec 26, 2025
@chalmerlowe
Copy link
Contributor

chalmerlowe commented Dec 26, 2025

@a-detiste Thanks for lining this up. You have been patient to see it merged.
I noticed that there appear to be several places where we are missing a transition from mock to unittest. Are you willing to update the PR?

If yes, please address the following errors:

_____________ ERROR collecting tests/compute_engine/test__mtls.py ______________
ImportError while importing test module '/tmpfs/src/github/google-auth-library-python/tests/compute_engine/test__mtls.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.14/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/compute_engine/test__mtls.py:20: in 
    import mock
E   ModuleNotFoundError: No module named 'mock'
_____________ ERROR collecting tests/test_agent_identity_utils.py ______________
ImportError while importing test module '/tmpfs/src/github/google-auth-library-python/tests/test_agent_identity_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.14/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_agent_identity_utils.py:21: in 
    import mock
E   ModuleNotFoundError: No module named 'mock'

Also, if you would be willing to include me as a maintainer on your branch just in case there is an additional issue, I can simply make the mods to the PR directly and avoid the back and forth.

Any help you can offer is appreciated. If your schedule does not allow you to continue supporting, that is understandable and I can see what I can do.

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.

5 participants