diff --git a/google/api_core/retry/__init__.py b/google/api_core/retry/__init__.py index 32f27659..7402563a 100644 --- a/google/api_core/retry/__init__.py +++ b/google/api_core/retry/__init__.py @@ -31,18 +31,18 @@ # The following imports are for backwards compatibility with https://github.com/googleapis/python-api-core/blob/4d7d2edee2c108d43deb151e6e0fdceb56b73275/google/api_core/retry.py # # TODO: Revert these imports on the next major version release (https://github.com/googleapis/python-api-core/issues/576) -import datetime -import functools -import logging -import random -import sys -import time -import inspect -import warnings -from typing import Any, Callable, TypeVar, TYPE_CHECKING -from google.api_core import datetime_helpers -from google.api_core import exceptions -from google.auth import exceptions as auth_exceptions +import datetime # noqa: F401 +import functools # noqa: F401 +import logging # noqa: F401 +import random # noqa: F401 +import sys # noqa: F401 +import time # noqa: F401 +import inspect # noqa: F401 +import warnings # noqa: F401 +from typing import Any, Callable, TypeVar, TYPE_CHECKING # noqa: F401 +from google.api_core import datetime_helpers # noqa: F401 +from google.api_core import exceptions # noqa: F401 +from google.auth import exceptions as auth_exceptions # noqa: F401 __all__ = ( "exponential_sleep_generator", diff --git a/tests/unit/retry/test_retry_imports.py b/tests/unit/retry/test_retry_imports.py index c967eb2a..5525e6f8 100644 --- a/tests/unit/retry/test_retry_imports.py +++ b/tests/unit/retry/test_retry_imports.py @@ -12,27 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest - def test_legacy_imports_retry_unary_sync(): # TODO: Delete this test when when we revert these imports on the # next major version release # (https://github.com/googleapis/python-api-core/issues/576) from google.api_core.retry import logging - from google.api_core.retry import datetime - from google.api_core.retry import functools - from google.api_core.retry import logging - from google.api_core.retry import random - from google.api_core.retry import sys - from google.api_core.retry import time - from google.api_core.retry import inspect - from google.api_core.retry import warnings - from google.api_core.retry import Any, Callable, TypeVar, TYPE_CHECKING - - from google.api_core.retry import datetime_helpers - from google.api_core.retry import exceptions - from google.api_core.retry import auth_exceptions + from google.api_core.retry import datetime # noqa: F401 + from google.api_core.retry import functools # noqa: F401 + from google.api_core.retry import logging # noqa: F401 + from google.api_core.retry import random # noqa: F401 + from google.api_core.retry import sys # noqa: F401 + from google.api_core.retry import time # noqa: F401 + from google.api_core.retry import inspect # noqa: F401 + from google.api_core.retry import warnings # noqa: F401 + from google.api_core.retry import Any, Callable, TypeVar, TYPE_CHECKING # noqa: F401 + + from google.api_core.retry import datetime_helpers # noqa: F401 + from google.api_core.retry import exceptions # noqa: F401 + from google.api_core.retry import auth_exceptions # noqa: F401 ### FIXME: How do we test the following, and how do we import it in __init__.py? # import google.api_core.retry.requests.exceptions @@ -43,7 +41,7 @@ def test_legacy_imports_retry_unary_async(): # next major version release # (https://github.com/googleapis/python-api-core/issues/576) - from google.api_core import retry_async + from google.api_core import retry_async # noqa: F401 ### FIXME: each of the following cause errors on the "retry_async" part: module not found # import google.api_core.retry_async.functools