aboutsummaryrefslogtreecommitdiff
path: root/tests/test__oauth2client.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test__oauth2client.py')
-rw-r--r--tests/test__oauth2client.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test__oauth2client.py b/tests/test__oauth2client.py
index aa06ece..6b1112b 100644
--- a/tests/test__oauth2client.py
+++ b/tests/test__oauth2client.py
@@ -13,7 +13,6 @@
# limitations under the License.
import datetime
-import importlib
import os
import sys
@@ -22,6 +21,7 @@ import oauth2client.client
import oauth2client.contrib.gce
import oauth2client.service_account
import pytest
+from six.moves import reload_module
from google.auth import _oauth2client
@@ -152,19 +152,19 @@ def test_convert_not_found():
@pytest.fixture
def reset__oauth2client_module():
"""Reloads the _oauth2client module after a test."""
- importlib.reload(_oauth2client)
+ reload_module(_oauth2client)
def test_import_has_app_engine(
mock_oauth2client_gae_imports, reset__oauth2client_module
):
- importlib.reload(_oauth2client)
+ reload_module(_oauth2client)
assert _oauth2client._HAS_APPENGINE
def test_import_without_oauth2client(monkeypatch, reset__oauth2client_module):
monkeypatch.setitem(sys.modules, "oauth2client", None)
with pytest.raises(ImportError) as excinfo:
- importlib.reload(_oauth2client)
+ reload_module(_oauth2client)
assert excinfo.match("oauth2client")