Skip to content

Commit 1c56079

Browse files
adamchainzBenRKarl
authored andcommitted
Move from mock to unittest.mock
1 parent a53ee09 commit 1c56079

8 files changed

Lines changed: 7 additions & 11 deletions

noxfile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def tests(session):
2222
session.install(".")
2323
# modules for testing
2424
session.install(
25-
"mock>=4.0.3",
2625
"pyfakefs>=3.5,<3.7",
2726
"coverage==6.5.0",
2827
)
@@ -48,7 +47,6 @@ def tests_minimum_dependency_versions(session):
4847
session.install(".")
4948
# modules for testing
5049
session.install(
51-
"mock>=4.0.3",
5250
"pyfakefs>=3.5,<3.7",
5351
"coverage==6.5.0",
5452
# Google-published dependencies pinned to the

tests/client_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from importlib import import_module
1717
from inspect import getmembers
18-
import mock
18+
from unittest import mock
1919
import os
2020
import pickle
2121
from pyfakefs.fake_filesystem_unittest import TestCase as FileTestCase

tests/config_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Tests the configuration helper module."""
1515

16-
import mock
16+
from unittest import mock
1717
import os
1818
import yaml
1919
from pyfakefs.fake_filesystem_unittest import TestCase as FileTestCase

tests/interceptors/exception_interceptor_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""Tests for the Exception gRPC Interceptor."""
1515

1616
import grpc
17-
import mock
17+
from unittest import mock
1818
from unittest import TestCase
1919

2020
from google.protobuf.message import Message as ProtobufMessageType

tests/interceptors/interceptor_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
from importlib import import_module
18-
import mock
18+
from unittest import mock
1919
from unittest import TestCase
2020

2121
import grpc

tests/interceptors/logging_interceptor_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
from importlib import import_module
1818
import json
1919
import logging
20+
from unittest import mock
2021
from unittest import TestCase
2122
from types import SimpleNamespace
2223

23-
import mock
24-
2524
from google.ads.googleads import client as Client
2625
from google.ads.googleads.interceptors import LoggingInterceptor
2726
from google.ads.googleads.interceptors.helpers import (

tests/interceptors/metadata_interceptor_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
# limitations under the License.
1414
"""Tests for the Metadata gRPC Interceptor."""
1515

16+
from unittest import mock
1617
from unittest import TestCase
1718
import sys
1819

19-
import mock
20-
2120
from google.ads.googleads.interceptors import MetadataInterceptor
2221

2322
# Dynamically generate the current Python version as a string in the format

tests/oauth2_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Tests for the OAuth2 helper module."""
1515

16-
import mock
16+
from unittest import mock
1717
from unittest import TestCase
1818

1919
from google.ads.googleads import oauth2

0 commit comments

Comments
 (0)