Skip to content

Commit

Permalink
chore: Use stdlib unittest.mock instead of separate mock library. Res…
Browse files Browse the repository at this point in the history
  • Loading branch information
clundin25 committed Jul 25, 2023
1 parent a4135a3 commit 9b26950
Show file tree
Hide file tree
Showing 45 changed files with 45 additions and 44 deletions.
Binary file modified system_tests/secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion system_tests/system_tests_sync/test_mtls_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import json
import mock
from unittest import mock
import os
import time
from os import path
Expand Down
1 change: 0 additions & 1 deletion testing/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Unit test requirements
flask
freezegun
mock
oauth2client
pyopenssl
pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/compute_engine/test__metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/compute_engine/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import os
import sys
from unittest import mock

import mock
import pytest # type: ignore


Expand Down
2 changes: 1 addition & 1 deletion tests/crypt/test__python_rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test__client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_challenges.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import base64
import sys
from unittest import mock

import mock
import pytest # type: ignore
import pyu2f # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_gdch_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import datetime
import json
import os
from unittest import mock

import mock
import pytest # type: ignore
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_id_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import json
import os
from unittest import mock

import mock
import pytest # type: ignore

from google.auth import environment_vars
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_reauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_service_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/test_sts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test__cloud_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test__default.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import json
import os
from unittest import mock

import mock
import pytest # type: ignore

from google.auth import _default
Expand Down
2 changes: 1 addition & 1 deletion tests/test__exponential_backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test__oauth2client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import importlib
import os
import sys
from unittest import mock

import mock
import pytest # type: ignore

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_downscoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_external_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_external_account_authorized_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_identity_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_impersonated_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pluggable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/transport/test__custom_tls_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,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
Expand Down
2 changes: 1 addition & 1 deletion tests/transport/test__mtls_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import os
import re
from unittest import mock

import mock
from OpenSSL import crypto
import pytest # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion tests/transport/test_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/transport/test_mtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/transport/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/transport/test_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests_async/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import os
import sys
from unittest import mock

import mock
import pytest # type: ignore


Expand Down
2 changes: 1 addition & 1 deletion tests_async/oauth2/test__client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests_async/oauth2/test_credentials_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests_async/oauth2/test_id_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import json
import os
from unittest import mock

import mock
import pytest # type: ignore

from google.auth import environment_vars
Expand Down
Loading

0 comments on commit 9b26950

Please sign in to comment.