Skip to content

Commit

Permalink
test: Switch to unittest.mock (googleapis#1864)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
s-t-e-v-e-n-k and parthea authored Aug 6, 2022
1 parent dd8a442 commit 8c87a41
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"pytest-cov",
"webtest",
"coverage",
"mock",
]


Expand Down
2 changes: 1 addition & 1 deletion tests/test__auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# limitations under the License.

import unittest
from unittest import mock

import google.auth.credentials
import google_auth_httplib2
import httplib2
import mock
import oauth2client.client

from googleapiclient import _auth
Expand Down
3 changes: 1 addition & 2 deletions tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
"""Unit tests for googleapiclient._helpers."""

import unittest
from unittest import mock
import urllib

import mock

from googleapiclient import _helpers


Expand Down
2 changes: 1 addition & 1 deletion tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
import re
import sys
import unittest
from unittest import mock
import urllib

import google.api_core.exceptions
import google.auth.credentials
from google.auth.exceptions import MutualTLSChannelError
import google_auth_httplib2
import httplib2
import mock
from oauth2client import GOOGLE_TOKEN_URI
from oauth2client.client import GoogleCredentials, OAuth2Credentials
from parameterized import parameterized
Expand Down
3 changes: 1 addition & 2 deletions tests/test_discovery_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import datetime
import unittest

import mock
from unittest import mock

from googleapiclient.discovery_cache import DISCOVERY_DOC_MAX_AGE

Expand Down
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
import ssl
import time
import unittest
from unittest import mock
import urllib

import httplib2
import mock
from oauth2client.client import Credentials

from googleapiclient.discovery import build
Expand Down

0 comments on commit 8c87a41

Please sign in to comment.