packages/python/python-google-auth/python-google-auth-2.28.0-remove_mock.patch

651 lines
17 KiB
Diff

diff --git i/system_tests/system_tests_sync/test_mtls_http.py w/system_tests/system_tests_sync/test_mtls_http.py
index bcf2a59..20836ad 100644
--- i/system_tests/system_tests_sync/test_mtls_http.py
+++ w/system_tests/system_tests_sync/test_mtls_http.py
@@ -13,7 +13,7 @@
# limitations under the License.
import json
-import mock
+from unittest import mock
import os
import time
from os import path
diff --git i/testing/requirements.txt w/testing/requirements.txt
index 27a0b3c..ccb53b0 100644
--- i/testing/requirements.txt
+++ w/testing/requirements.txt
@@ -1,7 +1,6 @@
# Unit test requirements
flask
freezegun
-mock
oauth2client
pyopenssl
pytest
diff --git i/tests/compute_engine/test__metadata.py w/tests/compute_engine/test__metadata.py
index 60ae355..91f15b5 100644
--- i/tests/compute_engine/test__metadata.py
+++ w/tests/compute_engine/test__metadata.py
@@ -17,8 +17,8 @@ import http.client as http_client
import importlib
import json
import os
+from unittest import mock
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/compute_engine/test_credentials.py w/tests/compute_engine/test_credentials.py
index 9cca317..ab2a058 100644
--- i/tests/compute_engine/test_credentials.py
+++ w/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 i/tests/conftest.py w/tests/conftest.py
index 8080ec3..fbce257 100644
--- i/tests/conftest.py
+++ w/tests/conftest.py
@@ -14,8 +14,8 @@
import os
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
diff --git i/tests/crypt/test__python_rsa.py w/tests/crypt/test__python_rsa.py
index 4a4ebe4..ec51e16 100644
--- i/tests/crypt/test__python_rsa.py
+++ w/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 i/tests/oauth2/test__client.py w/tests/oauth2/test__client.py
index 4cbd3a8..bff2aa4 100644
--- i/tests/oauth2/test__client.py
+++ w/tests/oauth2/test__client.py
@@ -16,9 +16,9 @@ import datetime
import http.client as http_client
import json
import os
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/oauth2/test_challenges.py w/tests/oauth2/test_challenges.py
index a06f552..f156f57 100644
--- i/tests/oauth2/test_challenges.py
+++ w/tests/oauth2/test_challenges.py
@@ -16,8 +16,8 @@
import base64
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
import pyu2f # type: ignore
diff --git i/tests/oauth2/test_credentials.py w/tests/oauth2/test_credentials.py
index 2166419..271ffeb 100644
--- i/tests/oauth2/test_credentials.py
+++ w/tests/oauth2/test_credentials.py
@@ -17,8 +17,8 @@ import json
import os
import pickle
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/oauth2/test_gdch_credentials.py w/tests/oauth2/test_gdch_credentials.py
index 63075ab..b889744 100644
--- i/tests/oauth2/test_gdch_credentials.py
+++ w/tests/oauth2/test_gdch_credentials.py
@@ -16,8 +16,8 @@ import copy
import datetime
import json
import os
+from unittest import mock
-import mock
import pytest # type: ignore
import requests
diff --git i/tests/oauth2/test_id_token.py w/tests/oauth2/test_id_token.py
index 40204f9..cdc4d3d 100644
--- i/tests/oauth2/test_id_token.py
+++ w/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 i/tests/oauth2/test_reauth.py w/tests/oauth2/test_reauth.py
index a95367a..ef19e4c 100644
--- i/tests/oauth2/test_reauth.py
+++ w/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 i/tests/oauth2/test_service_account.py w/tests/oauth2/test_service_account.py
index b0adf8d..fce44b5 100644
--- i/tests/oauth2/test_service_account.py
+++ w/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 i/tests/oauth2/test_sts.py w/tests/oauth2/test_sts.py
index e0fb4ae..395aac9 100644
--- i/tests/oauth2/test_sts.py
+++ w/tests/oauth2/test_sts.py
@@ -14,9 +14,9 @@
import http.client as http_client
import json
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import exceptions
diff --git i/tests/test__cloud_sdk.py w/tests/test__cloud_sdk.py
index e45c65b..dd14bce 100644
--- i/tests/test__cloud_sdk.py
+++ w/tests/test__cloud_sdk.py
@@ -17,8 +17,8 @@ import json
import os
import subprocess
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
from google.auth import _cloud_sdk
diff --git i/tests/test__default.py w/tests/test__default.py
index cb9a7c1..50a7a26 100644
--- i/tests/test__default.py
+++ w/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 i/tests/test__exponential_backoff.py w/tests/test__exponential_backoff.py
index 06a5452..a1b9540 100644
--- i/tests/test__exponential_backoff.py
+++ w/tests/test__exponential_backoff.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import mock
+from unittest import mock
from google.auth import _exponential_backoff
diff --git i/tests/test__oauth2client.py w/tests/test__oauth2client.py
index 9f0c192..52276ae 100644
--- i/tests/test__oauth2client.py
+++ w/tests/test__oauth2client.py
@@ -16,8 +16,8 @@ import datetime
import importlib
import os
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
try:
diff --git i/tests/test__refresh_worker.py w/tests/test__refresh_worker.py
index c25965d..f4e797c 100644
--- i/tests/test__refresh_worker.py
+++ w/tests/test__refresh_worker.py
@@ -16,8 +16,8 @@ import pickle
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 i/tests/test_app_engine.py w/tests/test_app_engine.py
index ca085bd..10b7bf3 100644
--- i/tests/test_app_engine.py
+++ w/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 i/tests/test_aws.py w/tests/test_aws.py
index 3f358d5..8d6ee5f 100644
--- i/tests/test_aws.py
+++ w/tests/test_aws.py
@@ -16,9 +16,9 @@ import datetime
import http.client as http_client
import json
import os
+from unittest import mock
import urllib.parse
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/test_credentials.py w/tests/test_credentials.py
index 8e6bbc9..3abe914 100644
--- i/tests/test_credentials.py
+++ w/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 i/tests/test_downscoped.py w/tests/test_downscoped.py
index fe6e291..209bbe3 100644
--- i/tests/test_downscoped.py
+++ w/tests/test_downscoped.py
@@ -15,9 +15,9 @@
import datetime
import http.client as http_client
import json
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/test_external_account.py w/tests/test_external_account.py
index 03a5014..29da0eb 100644
--- i/tests/test_external_account.py
+++ w/tests/test_external_account.py
@@ -15,9 +15,9 @@
import datetime
import http.client as http_client
import json
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/test_external_account_authorized_user.py w/tests/test_external_account_authorized_user.py
index 743ee9c..ba7e4a1 100644
--- i/tests/test_external_account_authorized_user.py
+++ w/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 i/tests/test_iam.py w/tests/test_iam.py
index 6706afb..9a70713 100644
--- i/tests/test_iam.py
+++ w/tests/test_iam.py
@@ -16,8 +16,8 @@ import base64
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 i/tests/test_identity_pool.py w/tests/test_identity_pool.py
index be30c4e..9f1dde8 100644
--- i/tests/test_identity_pool.py
+++ w/tests/test_identity_pool.py
@@ -16,9 +16,9 @@ import datetime
import http.client as http_client
import json
import os
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/test_impersonated_credentials.py w/tests/test_impersonated_credentials.py
index a2bf31b..f927286 100644
--- i/tests/test_impersonated_credentials.py
+++ w/tests/test_impersonated_credentials.py
@@ -16,8 +16,8 @@ import datetime
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 i/tests/test_jwt.py w/tests/test_jwt.py
index 28660ea..3029d6f 100644
--- i/tests/test_jwt.py
+++ w/tests/test_jwt.py
@@ -16,8 +16,8 @@ import base64
import datetime
import json
import os
+from unittest import mock
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests/test_metrics.py w/tests/test_metrics.py
index ba93892..b9036e3 100644
--- i/tests/test_metrics.py
+++ w/tests/test_metrics.py
@@ -13,8 +13,8 @@
# limitations under the License.
import platform
+from unittest import mock
-import mock
from google.auth import metrics
from google.auth import version
diff --git i/tests/test_pluggable.py w/tests/test_pluggable.py
index 6bee054..3fb76e8 100644
--- i/tests/test_pluggable.py
+++ w/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 i/tests/transport/test__custom_tls_signer.py w/tests/transport/test__custom_tls_signer.py
index d2907ba..d825498 100644
--- i/tests/transport/test__custom_tls_signer.py
+++ w/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 i/tests/transport/test__mtls_helper.py w/tests/transport/test__mtls_helper.py
index 1621a05..20e07ec 100644
--- i/tests/transport/test__mtls_helper.py
+++ w/tests/transport/test__mtls_helper.py
@@ -14,8 +14,8 @@
import os
import re
+from unittest import mock
-import mock
from OpenSSL import crypto
import pytest # type: ignore
diff --git i/tests/transport/test_grpc.py w/tests/transport/test_grpc.py
index f62ab0e..208ee5a 100644
--- i/tests/transport/test_grpc.py
+++ w/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 i/tests/transport/test_mtls.py w/tests/transport/test_mtls.py
index b62063e..71c6d87 100644
--- i/tests/transport/test_mtls.py
+++ w/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 i/tests/transport/test_requests.py w/tests/transport/test_requests.py
index aadc1dd..9fbecba 100644
--- i/tests/transport/test_requests.py
+++ w/tests/transport/test_requests.py
@@ -17,9 +17,9 @@ import functools
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 i/tests/transport/test_urllib3.py w/tests/transport/test_urllib3.py
index e832300..50044df 100644
--- i/tests/transport/test_urllib3.py
+++ w/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 i/tests_async/conftest.py w/tests_async/conftest.py
index f13dec0..55fd264 100644
--- i/tests_async/conftest.py
+++ w/tests_async/conftest.py
@@ -14,8 +14,8 @@
import os
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
diff --git i/tests_async/oauth2/test__client_async.py w/tests_async/oauth2/test__client_async.py
index add1b4e..4b84ad2 100644
--- i/tests_async/oauth2/test__client_async.py
+++ w/tests_async/oauth2/test__client_async.py
@@ -15,9 +15,9 @@
import datetime
import http.client as http_client
import json
+from unittest import mock
import urllib
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests_async/oauth2/test_credentials_async.py w/tests_async/oauth2/test_credentials_async.py
index fba0c3c..03f882d 100644
--- i/tests_async/oauth2/test_credentials_async.py
+++ w/tests_async/oauth2/test_credentials_async.py
@@ -17,8 +17,8 @@ import json
import os
import pickle
import sys
+from unittest import mock
-import mock
import pytest # type: ignore
from google.auth import _helpers
diff --git i/tests_async/oauth2/test_id_token.py w/tests_async/oauth2/test_id_token.py
index 9be086d..51d85da 100644
--- i/tests_async/oauth2/test_id_token.py
+++ w/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 i/tests_async/oauth2/test_reauth_async.py w/tests_async/oauth2/test_reauth_async.py
index 40ca927..4874a37 100644
--- i/tests_async/oauth2/test_reauth_async.py
+++ w/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 i/tests_async/oauth2/test_service_account_async.py w/tests_async/oauth2/test_service_account_async.py
index 176992f..5a9a89f 100644
--- i/tests_async/oauth2/test_service_account_async.py
+++ w/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 i/tests_async/test__default_async.py w/tests_async/test__default_async.py
index e1dbb1c..a1268bd 100644
--- i/tests_async/test__default_async.py
+++ w/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 i/tests_async/test_jwt_async.py w/tests_async/test_jwt_async.py
index f24a0a9..9d9eca4 100644
--- i/tests_async/test_jwt_async.py
+++ w/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 i/tests_async/transport/test_aiohttp_requests.py w/tests_async/transport/test_aiohttp_requests.py
index d00955a..550a37a 100644
--- i/tests_async/transport/test_aiohttp_requests.py
+++ w/tests_async/transport/test_aiohttp_requests.py
@@ -12,9 +12,10 @@
# 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 mock
import pytest # type: ignore
from tests_async.transport import async_compliance