Skip to content

Commit

Permalink
Move from mock to unittest.mock
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored and BenRKarl committed Nov 21, 2023
1 parent a53ee09 commit 1c56079
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def tests(session):
session.install(".")
# modules for testing
session.install(
"mock>=4.0.3",
"pyfakefs>=3.5,<3.7",
"coverage==6.5.0",
)
Expand All @@ -48,7 +47,6 @@ def tests_minimum_dependency_versions(session):
session.install(".")
# modules for testing
session.install(
"mock>=4.0.3",
"pyfakefs>=3.5,<3.7",
"coverage==6.5.0",
# Google-published dependencies pinned to the
Expand Down
2 changes: 1 addition & 1 deletion tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from importlib import import_module
from inspect import getmembers
import mock
from unittest import mock
import os
import pickle
from pyfakefs.fake_filesystem_unittest import TestCase as FileTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Tests the configuration helper module."""

import mock
from unittest import mock
import os
import yaml
from pyfakefs.fake_filesystem_unittest import TestCase as FileTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/interceptors/exception_interceptor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""Tests for the Exception gRPC Interceptor."""

import grpc
import mock
from unittest import mock
from unittest import TestCase

from google.protobuf.message import Message as ProtobufMessageType
Expand Down
2 changes: 1 addition & 1 deletion tests/interceptors/interceptor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


from importlib import import_module
import mock
from unittest import mock
from unittest import TestCase

import grpc
Expand Down
3 changes: 1 addition & 2 deletions tests/interceptors/logging_interceptor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
from importlib import import_module
import json
import logging
from unittest import mock
from unittest import TestCase
from types import SimpleNamespace

import mock

from google.ads.googleads import client as Client
from google.ads.googleads.interceptors import LoggingInterceptor
from google.ads.googleads.interceptors.helpers import (
Expand Down
3 changes: 1 addition & 2 deletions tests/interceptors/metadata_interceptor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
# limitations under the License.
"""Tests for the Metadata gRPC Interceptor."""

from unittest import mock
from unittest import TestCase
import sys

import mock

from google.ads.googleads.interceptors import MetadataInterceptor

# Dynamically generate the current Python version as a string in the format
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Tests for the OAuth2 helper module."""

import mock
from unittest import mock
from unittest import TestCase

from google.ads.googleads import oauth2
Expand Down

0 comments on commit 1c56079

Please sign in to comment.