fix: add back python 2.7 for gcloud usage only (#892)
* fix: add back python 2.7 for gcloud
* fix: fix setup and tests
* fix: add enum34 for python 2.7
* fix: add app engine app and fix noxfile
* fix: move test_app_engine.py
* fix: fix downscoped
* fix: fix downscoped
* fix: remove py2 from classifiers
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.contrib.gce
import oauth2client.service_account
import pytest
+from six.moves import reload_module
from google.auth import _oauth2client
@@ -152,19 +152,19 @@
@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")