Skip to content

Commit 8c87a41

Browse files
test: Switch to unittest.mock (#1864)
As of Python 3.4, the unittest module in the standard library has included mock, which means we can remove one external dependency. Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent dd8a442 commit 8c87a41

File tree

6 files changed

+5
-8
lines changed

6 files changed

+5
-8
lines changed

noxfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"pytest-cov",
4343
"webtest",
4444
"coverage",
45-
"mock",
4645
]
4746

4847

tests/test__auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# limitations under the License.
1414

1515
import unittest
16+
from unittest import mock
1617

1718
import google.auth.credentials
1819
import google_auth_httplib2
1920
import httplib2
20-
import mock
2121
import oauth2client.client
2222

2323
from googleapiclient import _auth

tests/test__helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"""Unit tests for googleapiclient._helpers."""
1616

1717
import unittest
18+
from unittest import mock
1819
import urllib
1920

20-
import mock
21-
2221
from googleapiclient import _helpers
2322

2423

tests/test_discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
import re
3636
import sys
3737
import unittest
38+
from unittest import mock
3839
import urllib
3940

4041
import google.api_core.exceptions
4142
import google.auth.credentials
4243
from google.auth.exceptions import MutualTLSChannelError
4344
import google_auth_httplib2
4445
import httplib2
45-
import mock
4646
from oauth2client import GOOGLE_TOKEN_URI
4747
from oauth2client.client import GoogleCredentials, OAuth2Credentials
4848
from parameterized import parameterized

tests/test_discovery_cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
import datetime
2121
import unittest
22-
23-
import mock
22+
from unittest import mock
2423

2524
from googleapiclient.discovery_cache import DISCOVERY_DOC_MAX_AGE
2625

tests/test_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
import ssl
3535
import time
3636
import unittest
37+
from unittest import mock
3738
import urllib
3839

3940
import httplib2
40-
import mock
4141
from oauth2client.client import Credentials
4242

4343
from googleapiclient.discovery import build

0 commit comments

Comments
 (0)