From 80130332a1872dfdb0bd5af81a1879ccd43bd1fc Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Mon, 30 Jun 2025 04:15:20 +0200 Subject: [PATCH 01/13] chore: remove use of old external "mock" module --- noxfile.py | 1 - setup.py | 1 - system_tests/system_tests_sync/test_external_accounts.py | 2 +- system_tests/system_tests_sync/test_mtls_http.py | 2 +- tests/compute_engine/test__metadata.py | 2 +- tests/compute_engine/test_credentials.py | 2 +- tests/conftest.py | 2 +- tests/crypt/test__python_rsa.py | 2 +- tests/oauth2/test__client.py | 2 +- tests/oauth2/test_challenges.py | 2 +- tests/oauth2/test_credentials.py | 2 +- tests/oauth2/test_gdch_credentials.py | 2 +- tests/oauth2/test_id_token.py | 2 +- tests/oauth2/test_reauth.py | 2 +- tests/oauth2/test_service_account.py | 2 +- tests/oauth2/test_sts.py | 2 +- tests/oauth2/test_webauthn_handler.py | 2 +- tests/oauth2/test_webauthn_handler_factory.py | 3 ++- tests/test__cloud_sdk.py | 2 +- tests/test__default.py | 2 +- tests/test__exponential_backoff.py | 3 ++- tests/test__oauth2client.py | 2 +- tests/test__refresh_worker.py | 2 +- tests/test_app_engine.py | 2 +- tests/test_aws.py | 2 +- tests/test_credentials.py | 2 +- tests/test_downscoped.py | 2 +- tests/test_external_account.py | 2 +- tests/test_external_account_authorized_user.py | 2 +- tests/test_iam.py | 2 +- tests/test_identity_pool.py | 2 +- tests/test_impersonated_credentials.py | 2 +- tests/test_jwt.py | 2 +- tests/test_metrics.py | 3 +-- tests/test_pluggable.py | 2 +- tests/transport/aio/test_aiohttp.py | 2 +- tests/transport/aio/test_sessions.py | 2 +- tests/transport/test__custom_tls_signer.py | 2 +- tests/transport/test__mtls_helper.py | 2 +- tests/transport/test_grpc.py | 2 +- tests/transport/test_mtls.py | 3 ++- tests/transport/test_requests.py | 2 +- tests/transport/test_urllib3.py | 2 +- tests_async/conftest.py | 2 +- tests_async/oauth2/test__client_async.py | 2 +- tests_async/oauth2/test_credentials_async.py | 2 +- tests_async/oauth2/test_id_token.py | 2 +- tests_async/oauth2/test_reauth_async.py | 2 +- tests_async/oauth2/test_service_account_async.py | 2 +- tests_async/test__default_async.py | 2 +- tests_async/test_jwt_async.py | 2 +- tests_async/transport/test_aiohttp_requests.py | 2 +- 52 files changed, 53 insertions(+), 53 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1071be0ad..52674483d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -79,7 +79,6 @@ def mypy(session): "types-pyOpenSSL", "types-requests", "types-setuptools", - "types-mock", ) session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async") diff --git a/setup.py b/setup.py index 3874354fd..0dea4a04b 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,6 @@ "grpcio", "flask", "freezegun", - "mock", # TODO(https://github.com/googleapis/google-auth-library-python/issues/1736): Remove `oauth2client` from testing requirements once an extra is added for `oauth2client` dependency. "oauth2client", *pyjwt_extra_require, diff --git a/system_tests/system_tests_sync/test_external_accounts.py b/system_tests/system_tests_sync/test_external_accounts.py index 837d0064b..eb15a011d 100644 --- a/system_tests/system_tests_sync/test_external_accounts.py +++ b/system_tests/system_tests_sync/test_external_accounts.py @@ -48,7 +48,7 @@ from http.server import HTTPServer from google.oauth2 import service_account import pytest -from mock import patch +from unittest.mock import patch # Populate values from the output of scripts/setup_external_accounts.sh. _AUDIENCE_OIDC = "//iam.googleapis.com/projects/79992041559/locations/global/workloadIdentityPools/pool-73wslmxn/providers/oidc-73wslmxn" diff --git a/system_tests/system_tests_sync/test_mtls_http.py b/system_tests/system_tests_sync/test_mtls_http.py index bcf2a59da..0955a15bf 100644 --- a/system_tests/system_tests_sync/test_mtls_http.py +++ b/system_tests/system_tests_sync/test_mtls_http.py @@ -13,10 +13,10 @@ # limitations under the License. import json -import mock import os import time from os import path +from unittest import mock import google.auth diff --git a/tests/compute_engine/test__metadata.py b/tests/compute_engine/test__metadata.py index c90bc603a..f7c591aa4 100644 --- a/tests/compute_engine/test__metadata.py +++ b/tests/compute_engine/test__metadata.py @@ -17,8 +17,8 @@ import importlib import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/compute_engine/test_credentials.py b/tests/compute_engine/test_credentials.py index 03fe845b1..2118ee96d 100644 --- a/tests/compute_engine/test_credentials.py +++ b/tests/compute_engine/test_credentials.py @@ -13,8 +13,8 @@ # limitations under the License. import base64 import datetime +from unittest import mock -import mock import pytest # type: ignore import responses # type: ignore diff --git a/tests/conftest.py b/tests/conftest.py index 8080ec3fa..fbce2575e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,8 +14,8 @@ import os import sys +from unittest import mock -import mock import pytest # type: ignore diff --git a/tests/crypt/test__python_rsa.py b/tests/crypt/test__python_rsa.py index 4a4ebe44e..ec51e16bb 100644 --- a/tests/crypt/test__python_rsa.py +++ b/tests/crypt/test__python_rsa.py @@ -15,8 +15,8 @@ import io import json import os +from unittest import mock -import mock from pyasn1_modules import pem # type: ignore import pytest # type: ignore import rsa # type: ignore diff --git a/tests/oauth2/test__client.py b/tests/oauth2/test__client.py index 6a085729f..c7484b846 100644 --- a/tests/oauth2/test__client.py +++ b/tests/oauth2/test__client.py @@ -17,8 +17,8 @@ import json import os import urllib +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/oauth2/test_challenges.py b/tests/oauth2/test_challenges.py index 4116b913a..5a853ac78 100644 --- a/tests/oauth2/test_challenges.py +++ b/tests/oauth2/test_challenges.py @@ -17,8 +17,8 @@ import base64 import os import sys +from unitest import mock -import mock import pytest # type: ignore import pyu2f # type: ignore diff --git a/tests/oauth2/test_credentials.py b/tests/oauth2/test_credentials.py index 7d2a9b872..a30dbccee 100644 --- a/tests/oauth2/test_credentials.py +++ b/tests/oauth2/test_credentials.py @@ -17,8 +17,8 @@ import os import pickle import sys +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/oauth2/test_gdch_credentials.py b/tests/oauth2/test_gdch_credentials.py index 63075aba0..b889744e6 100644 --- a/tests/oauth2/test_gdch_credentials.py +++ b/tests/oauth2/test_gdch_credentials.py @@ -16,8 +16,8 @@ import datetime import json import os +from unittest import mock -import mock import pytest # type: ignore import requests diff --git a/tests/oauth2/test_id_token.py b/tests/oauth2/test_id_token.py index ff3d4b6d8..68b74f11b 100644 --- a/tests/oauth2/test_id_token.py +++ b/tests/oauth2/test_id_token.py @@ -14,8 +14,8 @@ import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import environment_vars diff --git a/tests/oauth2/test_reauth.py b/tests/oauth2/test_reauth.py index a95367a2b..ef19e4c84 100644 --- a/tests/oauth2/test_reauth.py +++ b/tests/oauth2/test_reauth.py @@ -13,8 +13,8 @@ # limitations under the License. import copy +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests/oauth2/test_service_account.py b/tests/oauth2/test_service_account.py index 91a7d93e0..2aeab2ac5 100644 --- a/tests/oauth2/test_service_account.py +++ b/tests/oauth2/test_service_account.py @@ -15,8 +15,8 @@ import datetime import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/oauth2/test_sts.py b/tests/oauth2/test_sts.py index e0fb4ae23..61cf3bf32 100644 --- a/tests/oauth2/test_sts.py +++ b/tests/oauth2/test_sts.py @@ -15,8 +15,8 @@ import http.client as http_client import json import urllib +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests/oauth2/test_webauthn_handler.py b/tests/oauth2/test_webauthn_handler.py index 9fba266da..1dd75d6e1 100644 --- a/tests/oauth2/test_webauthn_handler.py +++ b/tests/oauth2/test_webauthn_handler.py @@ -1,7 +1,7 @@ import json import struct +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests/oauth2/test_webauthn_handler_factory.py b/tests/oauth2/test_webauthn_handler_factory.py index 47890ce4b..1323de909 100644 --- a/tests/oauth2/test_webauthn_handler_factory.py +++ b/tests/oauth2/test_webauthn_handler_factory.py @@ -1,4 +1,5 @@ -import mock +from unittest import mock + import pytest # type: ignore from google.oauth2 import webauthn_handler diff --git a/tests/test__cloud_sdk.py b/tests/test__cloud_sdk.py index e45c65bd9..dd14bcebe 100644 --- a/tests/test__cloud_sdk.py +++ b/tests/test__cloud_sdk.py @@ -17,8 +17,8 @@ import os import subprocess import sys +from unittest import mock -import mock import pytest # type: ignore from google.auth import _cloud_sdk diff --git a/tests/test__default.py b/tests/test__default.py index e42b4dd94..4b294de2b 100644 --- a/tests/test__default.py +++ b/tests/test__default.py @@ -14,8 +14,8 @@ import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _default diff --git a/tests/test__exponential_backoff.py b/tests/test__exponential_backoff.py index b7b6877b2..7ac05ba73 100644 --- a/tests/test__exponential_backoff.py +++ b/tests/test__exponential_backoff.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import pytest # type: ignore from google.auth import _exponential_backoff diff --git a/tests/test__oauth2client.py b/tests/test__oauth2client.py index 2d4a809bb..730f07450 100644 --- a/tests/test__oauth2client.py +++ b/tests/test__oauth2client.py @@ -16,8 +16,8 @@ import importlib import os import sys +from unittest import mock -import mock import pytest # type: ignore try: diff --git a/tests/test__refresh_worker.py b/tests/test__refresh_worker.py index c25965d10..f4e797c75 100644 --- a/tests/test__refresh_worker.py +++ b/tests/test__refresh_worker.py @@ -16,8 +16,8 @@ import random import threading import time +from unittest import mock -import mock import pytest # type: ignore from google.auth import _refresh_worker, credentials, exceptions diff --git a/tests/test_app_engine.py b/tests/test_app_engine.py index ca085bd69..10b7bf371 100644 --- a/tests/test_app_engine.py +++ b/tests/test_app_engine.py @@ -13,8 +13,8 @@ # limitations under the License. import datetime +from unittest import mock -import mock import pytest # type: ignore from google.auth import app_engine diff --git a/tests/test_aws.py b/tests/test_aws.py index df1f02e7d..44de5d594 100644 --- a/tests/test_aws.py +++ b/tests/test_aws.py @@ -17,8 +17,8 @@ import json import os import urllib.parse +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers, external_account diff --git a/tests/test_credentials.py b/tests/test_credentials.py index e11bcb4e5..9d56e85d9 100644 --- a/tests/test_credentials.py +++ b/tests/test_credentials.py @@ -13,8 +13,8 @@ # limitations under the License. import datetime +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_downscoped.py b/tests/test_downscoped.py index fe6e291c7..3c78f67bb 100644 --- a/tests/test_downscoped.py +++ b/tests/test_downscoped.py @@ -16,8 +16,8 @@ import http.client as http_client import json import urllib +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_external_account.py b/tests/test_external_account.py index bddcb4afa..eb0764e1b 100644 --- a/tests/test_external_account.py +++ b/tests/test_external_account.py @@ -16,8 +16,8 @@ import http.client as http_client import json import urllib +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_external_account_authorized_user.py b/tests/test_external_account_authorized_user.py index 93926a131..3ff8c0bff 100644 --- a/tests/test_external_account_authorized_user.py +++ b/tests/test_external_account_authorized_user.py @@ -15,8 +15,8 @@ import datetime import http.client as http_client import json +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests/test_iam.py b/tests/test_iam.py index 01c2fa085..26a4c825a 100644 --- a/tests/test_iam.py +++ b/tests/test_iam.py @@ -16,8 +16,8 @@ import datetime import http.client as http_client import json +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_identity_pool.py b/tests/test_identity_pool.py index 41fd18892..7f897f932 100644 --- a/tests/test_identity_pool.py +++ b/tests/test_identity_pool.py @@ -18,8 +18,8 @@ import json import os import urllib +from unittest import mock -import mock from OpenSSL import crypto import pytest # type: ignore diff --git a/tests/test_impersonated_credentials.py b/tests/test_impersonated_credentials.py index 4aa357e3e..35eaa1021 100644 --- a/tests/test_impersonated_credentials.py +++ b/tests/test_impersonated_credentials.py @@ -17,8 +17,8 @@ import http.client as http_client import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_jwt.py b/tests/test_jwt.py index 28660ea33..3029d6f1d 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -16,8 +16,8 @@ import datetime import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/test_metrics.py b/tests/test_metrics.py index ba9389267..c2e4014a0 100644 --- a/tests/test_metrics.py +++ b/tests/test_metrics.py @@ -13,8 +13,7 @@ # limitations under the License. import platform - -import mock +from unittest import mock from google.auth import metrics from google.auth import version diff --git a/tests/test_pluggable.py b/tests/test_pluggable.py index 6bee054c5..3fb76e897 100644 --- a/tests/test_pluggable.py +++ b/tests/test_pluggable.py @@ -15,8 +15,8 @@ import json import os import subprocess +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests/transport/aio/test_aiohttp.py b/tests/transport/aio/test_aiohttp.py index 632abff25..13f86ba34 100644 --- a/tests/transport/aio/test_aiohttp.py +++ b/tests/transport/aio/test_aiohttp.py @@ -13,9 +13,9 @@ # limitations under the License. import asyncio +from unittest.mock import AsyncMock, Mock, patch from aioresponses import aioresponses # type: ignore -from mock import AsyncMock, Mock, patch import pytest # type: ignore import pytest_asyncio # type: ignore diff --git a/tests/transport/aio/test_sessions.py b/tests/transport/aio/test_sessions.py index c91a7c40a..697c17a58 100644 --- a/tests/transport/aio/test_sessions.py +++ b/tests/transport/aio/test_sessions.py @@ -14,9 +14,9 @@ import asyncio from typing import AsyncGenerator +from unittest.mock import Mock, patch from aioresponses import aioresponses # type: ignore -from mock import Mock, patch import pytest # type: ignore from google.auth.aio.credentials import AnonymousCredentials diff --git a/tests/transport/test__custom_tls_signer.py b/tests/transport/test__custom_tls_signer.py index 3a33c2c02..273a45869 100644 --- a/tests/transport/test__custom_tls_signer.py +++ b/tests/transport/test__custom_tls_signer.py @@ -14,8 +14,8 @@ import base64 import ctypes import os +from unittest import mock -import mock import pytest # type: ignore from requests.packages.urllib3.util.ssl_ import create_urllib3_context # type: ignore import urllib3.contrib.pyopenssl # type: ignore diff --git a/tests/transport/test__mtls_helper.py b/tests/transport/test__mtls_helper.py index f6e20b726..d16959042 100644 --- a/tests/transport/test__mtls_helper.py +++ b/tests/transport/test__mtls_helper.py @@ -14,8 +14,8 @@ import os import re +from unittes import mock -import mock from OpenSSL import crypto import pytest # type: ignore diff --git a/tests/transport/test_grpc.py b/tests/transport/test_grpc.py index ed3f3ee83..7ebd14758 100644 --- a/tests/transport/test_grpc.py +++ b/tests/transport/test_grpc.py @@ -15,8 +15,8 @@ import datetime import os import time +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests/transport/test_mtls.py b/tests/transport/test_mtls.py index ea549ae14..0b02c68a7 100644 --- a/tests/transport/test_mtls.py +++ b/tests/transport/test_mtls.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import pytest # type: ignore from google.auth import exceptions diff --git a/tests/transport/test_requests.py b/tests/transport/test_requests.py index 0da3e36d9..932a7c0b3 100644 --- a/tests/transport/test_requests.py +++ b/tests/transport/test_requests.py @@ -17,9 +17,9 @@ import http.client as http_client import os import sys +from unittest import mock import freezegun -import mock import OpenSSL import pytest # type: ignore import requests diff --git a/tests/transport/test_urllib3.py b/tests/transport/test_urllib3.py index e83230032..50044df15 100644 --- a/tests/transport/test_urllib3.py +++ b/tests/transport/test_urllib3.py @@ -15,8 +15,8 @@ import http.client as http_client import os import sys +from unittest import mock -import mock import OpenSSL import pytest # type: ignore import urllib3 # type: ignore diff --git a/tests_async/conftest.py b/tests_async/conftest.py index f13dec0e4..55fd26463 100644 --- a/tests_async/conftest.py +++ b/tests_async/conftest.py @@ -14,8 +14,8 @@ import os import sys +from unittest import mock -import mock import pytest # type: ignore diff --git a/tests_async/oauth2/test__client_async.py b/tests_async/oauth2/test__client_async.py index 7ffbc7ae1..e818e1127 100644 --- a/tests_async/oauth2/test__client_async.py +++ b/tests_async/oauth2/test__client_async.py @@ -16,8 +16,8 @@ import http.client as http_client import json import urllib +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests_async/oauth2/test_credentials_async.py b/tests_async/oauth2/test_credentials_async.py index fba0c3cf9..03f882d5c 100644 --- a/tests_async/oauth2/test_credentials_async.py +++ b/tests_async/oauth2/test_credentials_async.py @@ -17,8 +17,8 @@ import os import pickle import sys +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests_async/oauth2/test_id_token.py b/tests_async/oauth2/test_id_token.py index 9be086dca..51d85daf2 100644 --- a/tests_async/oauth2/test_id_token.py +++ b/tests_async/oauth2/test_id_token.py @@ -14,8 +14,8 @@ import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import environment_vars diff --git a/tests_async/oauth2/test_reauth_async.py b/tests_async/oauth2/test_reauth_async.py index 40ca92717..4874a3728 100644 --- a/tests_async/oauth2/test_reauth_async.py +++ b/tests_async/oauth2/test_reauth_async.py @@ -13,8 +13,8 @@ # limitations under the License. import copy +from unittest import mock -import mock import pytest # type: ignore from google.auth import exceptions diff --git a/tests_async/oauth2/test_service_account_async.py b/tests_async/oauth2/test_service_account_async.py index 176992f77..5a9a89fca 100644 --- a/tests_async/oauth2/test_service_account_async.py +++ b/tests_async/oauth2/test_service_account_async.py @@ -13,8 +13,8 @@ # limitations under the License. import datetime +from unittest import mock -import mock import pytest # type: ignore from google.auth import _helpers diff --git a/tests_async/test__default_async.py b/tests_async/test__default_async.py index e1dbb1c09..a1268bdc0 100644 --- a/tests_async/test__default_async.py +++ b/tests_async/test__default_async.py @@ -14,8 +14,8 @@ import json import os +from unittest import mock -import mock import pytest # type: ignore from google.auth import _credentials_async as credentials diff --git a/tests_async/test_jwt_async.py b/tests_async/test_jwt_async.py index f24a0a99d..9d9eca4e2 100644 --- a/tests_async/test_jwt_async.py +++ b/tests_async/test_jwt_async.py @@ -14,8 +14,8 @@ import datetime import json +from unittest import mock -import mock import pytest # type: ignore from google.auth import _jwt_async as jwt_async diff --git a/tests_async/transport/test_aiohttp_requests.py b/tests_async/transport/test_aiohttp_requests.py index d00955a7d..a67cd52b6 100644 --- a/tests_async/transport/test_aiohttp_requests.py +++ b/tests_async/transport/test_aiohttp_requests.py @@ -14,7 +14,7 @@ import aiohttp # type: ignore from aioresponses import aioresponses, core # type: ignore -import mock +from unittest import mock import pytest # type: ignore from tests_async.transport import async_compliance From 6c066d0648666560f004bf7830ca56a6643b5a4d Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:03:44 -0500 Subject: [PATCH 02/13] Update tests_async/transport/test_aiohttp_requests.py --- tests_async/transport/test_aiohttp_requests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests_async/transport/test_aiohttp_requests.py b/tests_async/transport/test_aiohttp_requests.py index fc8a572d5..b78af89a1 100644 --- a/tests_async/transport/test_aiohttp_requests.py +++ b/tests_async/transport/test_aiohttp_requests.py @@ -14,7 +14,6 @@ import aiohttp # type: ignore from aioresponses import aioresponses, core # type: ignore -from unittest import mock import pytest # type: ignore from tests_async.transport import async_compliance From 5a65b78cd753e001c95d46917e1a22618a0169f4 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:00 -0500 Subject: [PATCH 03/13] Update tests_async/transport/test_aiohttp_requests.py --- tests_async/transport/test_aiohttp_requests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests_async/transport/test_aiohttp_requests.py b/tests_async/transport/test_aiohttp_requests.py index b78af89a1..d6a24da2e 100644 --- a/tests_async/transport/test_aiohttp_requests.py +++ b/tests_async/transport/test_aiohttp_requests.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from unittest import mock + import aiohttp # type: ignore from aioresponses import aioresponses, core # type: ignore import pytest # type: ignore From ac66a7c53a7795d1d3907db6a0c981478e509dbd Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:10 -0500 Subject: [PATCH 04/13] Update tests/oauth2/test__client.py --- tests/oauth2/test__client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/oauth2/test__client.py b/tests/oauth2/test__client.py index 592c29e4f..6a01b1bac 100644 --- a/tests/oauth2/test__client.py +++ b/tests/oauth2/test__client.py @@ -16,8 +16,8 @@ import http.client as http_client import json import os -import urllib from unittest import mock +import urllib import pytest # type: ignore From 934435f18b79dff6df76fb75b2c388f4e91fa71c Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:16 -0500 Subject: [PATCH 05/13] Update tests/oauth2/test_challenges.py --- tests/oauth2/test_challenges.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/oauth2/test_challenges.py b/tests/oauth2/test_challenges.py index 532c7bf4e..c9b60148a 100644 --- a/tests/oauth2/test_challenges.py +++ b/tests/oauth2/test_challenges.py @@ -17,7 +17,7 @@ import base64 import os import sys -from unitest import mock +from unittest import mock import pytest # type: ignore import pyu2f # type: ignore From c4c13da1fea43221b29109ae0ed18f698c87e029 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:23 -0500 Subject: [PATCH 06/13] Update tests/oauth2/test_sts.py --- tests/oauth2/test_sts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/oauth2/test_sts.py b/tests/oauth2/test_sts.py index dd82e8bfd..5d0f557e3 100644 --- a/tests/oauth2/test_sts.py +++ b/tests/oauth2/test_sts.py @@ -14,8 +14,8 @@ import http.client as http_client import json -import urllib from unittest import mock +import urllib import pytest # type: ignore From 337af6591a1598ea1fcabaffcb5fee4f847ca72d Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:33 -0500 Subject: [PATCH 07/13] Update tests/test_aws.py --- tests/test_aws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_aws.py b/tests/test_aws.py index d9acf4b98..1fd78e191 100644 --- a/tests/test_aws.py +++ b/tests/test_aws.py @@ -16,8 +16,8 @@ import http.client as http_client import json import os -import urllib.parse from unittest import mock +import urllib.parse import pytest # type: ignore From 4212b09dcefa4dd60d3097702ca5f2870b090d3a Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:38 -0500 Subject: [PATCH 08/13] Update tests/test_downscoped.py --- tests/test_downscoped.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_downscoped.py b/tests/test_downscoped.py index 2e490383d..1982f3d8e 100644 --- a/tests/test_downscoped.py +++ b/tests/test_downscoped.py @@ -15,8 +15,8 @@ import datetime import http.client as http_client import json -import urllib from unittest import mock +import urllib import pytest # type: ignore From 4304512c62a4c358188d7021b9c106cf4addf454 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:45 -0500 Subject: [PATCH 09/13] Update tests/test_identity_pool.py --- tests/test_identity_pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_identity_pool.py b/tests/test_identity_pool.py index 6c44ba8ca..8e394d8fc 100644 --- a/tests/test_identity_pool.py +++ b/tests/test_identity_pool.py @@ -17,8 +17,8 @@ import http.client as http_client import json import os -import urllib from unittest import mock +import urllib from OpenSSL import crypto import pytest # type: ignore From 79b23c44a96dcf6da52ae681bcc118f0de706f26 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:04:55 -0500 Subject: [PATCH 10/13] Update tests/transport/test__mtls_helper.py --- tests/transport/test__mtls_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/transport/test__mtls_helper.py b/tests/transport/test__mtls_helper.py index 7983e8200..1cdd91739 100644 --- a/tests/transport/test__mtls_helper.py +++ b/tests/transport/test__mtls_helper.py @@ -14,7 +14,7 @@ import os import re -from unittes import mock +from unittest import mock from OpenSSL import crypto import pytest # type: ignore From 9c254cc6745a14962bbb668bcb16c84d2d31769c Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:05:01 -0500 Subject: [PATCH 11/13] Update tests_async/oauth2/test__client_async.py --- tests_async/oauth2/test__client_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests_async/oauth2/test__client_async.py b/tests_async/oauth2/test__client_async.py index f3cb9e551..5ad9596cf 100644 --- a/tests_async/oauth2/test__client_async.py +++ b/tests_async/oauth2/test__client_async.py @@ -15,8 +15,8 @@ import datetime import http.client as http_client import json -import urllib from unittest import mock +import urllib import pytest # type: ignore From d5988615cf8ae81359639072dcd690d519eee548 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 26 Dec 2025 08:05:13 -0500 Subject: [PATCH 12/13] Update tests/test_external_account.py --- tests/test_external_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_external_account.py b/tests/test_external_account.py index 59823c053..4daf942e6 100644 --- a/tests/test_external_account.py +++ b/tests/test_external_account.py @@ -16,8 +16,8 @@ import http.client as http_client import json import os -import urllib from unittest import mock +import urllib import pytest # type: ignore From 2d86e57932b4005122c37d0d6281d0ef19d3e002 Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Fri, 26 Dec 2025 20:38:44 +0100 Subject: [PATCH 13/13] fix two more "mock" imports --- tests/compute_engine/test__mtls.py | 2 +- tests/test_agent_identity_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compute_engine/test__mtls.py b/tests/compute_engine/test__mtls.py index fdd61a07d..6b40b6682 100644 --- a/tests/compute_engine/test__mtls.py +++ b/tests/compute_engine/test__mtls.py @@ -16,8 +16,8 @@ # from pathlib import Path +from unittest import mock -import mock import pytest # type: ignore import requests diff --git a/tests/test_agent_identity_utils.py b/tests/test_agent_identity_utils.py index 86a63e82e..cd3f2ad80 100644 --- a/tests/test_agent_identity_utils.py +++ b/tests/test_agent_identity_utils.py @@ -16,9 +16,9 @@ import hashlib import json import urllib.parse +from unittest import mock from cryptography import x509 -import mock import pytest from google.auth import _agent_identity_utils