chore: blacken (#206)

Also, fix 2.7 tests broken by release of 'googleapis-common-protos 1.53.0',
which dropped Python 2.7 support.

Closes #169
diff --git a/docs/conf.py b/docs/conf.py
index 1e73c44..eb2f536 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -313,13 +313,7 @@
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    (
-        master_doc,
-        "google-api-core",
-        u"google-api-core Documentation",
-        [author],
-        1,
-    )
+    (master_doc, "google-api-core", u"google-api-core Documentation", [author], 1,)
 ]
 
 # If true, show URL addresses after external links.
@@ -360,14 +354,10 @@
 intersphinx_mapping = {
     "python": ("https://python.readthedocs.org/en/latest/", None),
     "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
-    "google.api_core": (
-        "https://googleapis.dev/python/google-api-core/latest/",
-        None,
-    ),
+    "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
     "grpc": ("https://grpc.github.io/grpc/python/", None),
     "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
     "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
-    
 }
 
 
diff --git a/google/api_core/future/async_future.py b/google/api_core/future/async_future.py
index e1d158d..0343fbe 100644
--- a/google/api_core/future/async_future.py
+++ b/google/api_core/future/async_future.py
@@ -24,6 +24,7 @@
 
 class _OperationNotComplete(Exception):
     """Private exception used for polling via retry."""
+
     pass
 
 
@@ -145,7 +146,9 @@
                 is complete.
         """
         if self._background_task is None:
-            self._background_task = asyncio.get_event_loop().create_task(self._blocking_poll())
+            self._background_task = asyncio.get_event_loop().create_task(
+                self._blocking_poll()
+            )
         self._future.add_done_callback(fn)
 
     def set_result(self, result):
diff --git a/google/api_core/gapic_v1/__init__.py b/google/api_core/gapic_v1/__init__.py
index ed95da1..6632047 100644
--- a/google/api_core/gapic_v1/__init__.py
+++ b/google/api_core/gapic_v1/__init__.py
@@ -24,5 +24,6 @@
 if sys.version_info >= (3, 6):
     from google.api_core.gapic_v1 import config_async  # noqa: F401
     from google.api_core.gapic_v1 import method_async  # noqa: F401
+
     __all__.append("config_async")
     __all__.append("method_async")
diff --git a/google/api_core/gapic_v1/config.py b/google/api_core/gapic_v1/config.py
index 2a56cf1..29e8645 100644
--- a/google/api_core/gapic_v1/config.py
+++ b/google/api_core/gapic_v1/config.py
@@ -153,7 +153,9 @@
         if retry_params_name is not None:
             retry_params = retry_params_map[retry_params_name]
             retry_ = _retry_from_retry_config(
-                retry_params, retry_codes_map[method_params["retry_codes_name"]], retry_impl
+                retry_params,
+                retry_codes_map[method_params["retry_codes_name"]],
+                retry_impl,
             )
             timeout_ = _timeout_from_retry_config(retry_params)
 
diff --git a/google/api_core/gapic_v1/config_async.py b/google/api_core/gapic_v1/config_async.py
index 00e5e24..13d6a48 100644
--- a/google/api_core/gapic_v1/config_async.py
+++ b/google/api_core/gapic_v1/config_async.py
@@ -38,5 +38,5 @@
             configuration.
     """
     return config.parse_method_configs(
-        interface_config,
-        retry_impl=retry_async.AsyncRetry)
+        interface_config, retry_impl=retry_async.AsyncRetry
+    )
diff --git a/google/api_core/gapic_v1/method_async.py b/google/api_core/gapic_v1/method_async.py
index 5210b2b..76e5757 100644
--- a/google/api_core/gapic_v1/method_async.py
+++ b/google/api_core/gapic_v1/method_async.py
@@ -19,16 +19,16 @@
 
 from google.api_core import general_helpers, grpc_helpers_async
 from google.api_core.gapic_v1 import client_info
-from google.api_core.gapic_v1.method import (_GapicCallable,  # noqa: F401
-                                             DEFAULT,
-                                             USE_DEFAULT_METADATA)
+from google.api_core.gapic_v1.method import _GapicCallable
+from google.api_core.gapic_v1.method import DEFAULT  # noqa: F401
+from google.api_core.gapic_v1.method import USE_DEFAULT_METADATA  # noqa: F401
 
 
 def wrap_method(
-        func,
-        default_retry=None,
-        default_timeout=None,
-        client_info=client_info.DEFAULT_CLIENT_INFO,
+    func,
+    default_retry=None,
+    default_timeout=None,
+    client_info=client_info.DEFAULT_CLIENT_INFO,
 ):
     """Wrap an async RPC method with common behavior.
 
@@ -41,5 +41,6 @@
 
     metadata = [client_info.to_grpc_metadata()] if client_info is not None else None
 
-    return general_helpers.wraps(func)(_GapicCallable(
-        func, default_retry, default_timeout, metadata=metadata))
+    return general_helpers.wraps(func)(
+        _GapicCallable(func, default_retry, default_timeout, metadata=metadata)
+    )
diff --git a/google/api_core/grpc_helpers.py b/google/api_core/grpc_helpers.py
index e8f9ee8..62d9e53 100644
--- a/google/api_core/grpc_helpers.py
+++ b/google/api_core/grpc_helpers.py
@@ -157,7 +157,9 @@
             # hidden flag to see if pre-fetching is disabled.
             # https://github.com/googleapis/python-pubsub/issues/93#issuecomment-630762257
             prefetch_first = getattr(callable_, "_prefetch_first_result_", True)
-            return _StreamingResponseIterator(result, prefetch_first_result=prefetch_first)
+            return _StreamingResponseIterator(
+                result, prefetch_first_result=prefetch_first
+            )
         except grpc.RpcError as exc:
             six.raise_from(exceptions.from_grpc_error(exc), exc)
 
@@ -187,13 +189,14 @@
 
 
 def _create_composite_credentials(
-        credentials=None,
-        credentials_file=None,
-        default_scopes=None,
-        scopes=None,
-        ssl_credentials=None,
-        quota_project_id=None,
-        default_host=None):
+    credentials=None,
+    credentials_file=None,
+    default_scopes=None,
+    scopes=None,
+    ssl_credentials=None,
+    quota_project_id=None,
+    default_host=None,
+):
     """Create the composite credentials for secure channels.
 
     Args:
@@ -227,20 +230,20 @@
 
     if credentials_file:
         credentials, _ = google.auth.load_credentials_from_file(
-            credentials_file,
-            scopes=scopes,
-            default_scopes=default_scopes
+            credentials_file, scopes=scopes, default_scopes=default_scopes
         )
     elif credentials:
         credentials = google.auth.credentials.with_scopes_if_required(
-            credentials,
-            scopes=scopes,
-            default_scopes=default_scopes
+            credentials, scopes=scopes, default_scopes=default_scopes
         )
     else:
-        credentials, _ = google.auth.default(scopes=scopes, default_scopes=default_scopes)
+        credentials, _ = google.auth.default(
+            scopes=scopes, default_scopes=default_scopes
+        )
 
-    if quota_project_id and isinstance(credentials, google.auth.credentials.CredentialsWithQuotaProject):
+    if quota_project_id and isinstance(
+        credentials, google.auth.credentials.CredentialsWithQuotaProject
+    ):
         credentials = credentials.with_quota_project(quota_project_id)
 
     request = google.auth.transport.requests.Request()
@@ -257,21 +260,20 @@
         ssl_credentials = grpc.ssl_channel_credentials()
 
     # Combine the ssl credentials and the authorization credentials.
-    return grpc.composite_channel_credentials(
-        ssl_credentials, google_auth_credentials
-    )
+    return grpc.composite_channel_credentials(ssl_credentials, google_auth_credentials)
 
 
 def create_channel(
-        target,
-        credentials=None,
-        scopes=None,
-        ssl_credentials=None,
-        credentials_file=None,
-        quota_project_id=None,
-        default_scopes=None,
-        default_host=None,
-        **kwargs):
+    target,
+    credentials=None,
+    scopes=None,
+    ssl_credentials=None,
+    credentials_file=None,
+    quota_project_id=None,
+    default_scopes=None,
+    default_host=None,
+    **kwargs
+):
     """Create a secure channel with credentials.
 
     Args:
diff --git a/google/api_core/grpc_helpers_async.py b/google/api_core/grpc_helpers_async.py
index 14eb5a1..92df645 100644
--- a/google/api_core/grpc_helpers_async.py
+++ b/google/api_core/grpc_helpers_async.py
@@ -36,7 +36,6 @@
 
 
 class _WrappedCall(aio.Call):
-
     def __init__(self):
         self._call = None
 
@@ -80,7 +79,6 @@
 
 
 class _WrappedUnaryResponseMixin(_WrappedCall):
-
     def __await__(self):
         try:
             response = yield from self._call.__await__()
@@ -90,7 +88,6 @@
 
 
 class _WrappedStreamResponseMixin(_WrappedCall):
-
     def __init__(self):
         self._wrapped_async_generator = None
 
@@ -117,7 +114,6 @@
 
 
 class _WrappedStreamRequestMixin(_WrappedCall):
-
     async def write(self, request):
         try:
             await self._call.write(request)
@@ -142,11 +138,15 @@
     """Wrapped UnaryStreamCall to map exceptions."""
 
 
-class _WrappedStreamUnaryCall(_WrappedUnaryResponseMixin, _WrappedStreamRequestMixin, aio.StreamUnaryCall):
+class _WrappedStreamUnaryCall(
+    _WrappedUnaryResponseMixin, _WrappedStreamRequestMixin, aio.StreamUnaryCall
+):
     """Wrapped StreamUnaryCall to map exceptions."""
 
 
-class _WrappedStreamStreamCall(_WrappedStreamRequestMixin, _WrappedStreamResponseMixin, aio.StreamStreamCall):
+class _WrappedStreamStreamCall(
+    _WrappedStreamRequestMixin, _WrappedStreamResponseMixin, aio.StreamStreamCall
+):
     """Wrapped StreamStreamCall to map exceptions."""
 
 
@@ -177,7 +177,7 @@
         elif isinstance(call, aio.StreamStreamCall):
             call = _WrappedStreamStreamCall().with_call(call)
         else:
-            raise TypeError('Unexpected type of call %s' % type(call))
+            raise TypeError("Unexpected type of call %s" % type(call))
 
         await call.wait_for_connection()
         return call
@@ -207,15 +207,16 @@
 
 
 def create_channel(
-        target,
-        credentials=None,
-        scopes=None,
-        ssl_credentials=None,
-        credentials_file=None,
-        quota_project_id=None,
-        default_scopes=None,
-        default_host=None,
-        **kwargs):
+    target,
+    credentials=None,
+    scopes=None,
+    ssl_credentials=None,
+    credentials_file=None,
+    quota_project_id=None,
+    default_scopes=None,
+    default_host=None,
+    **kwargs
+):
     """Create an AsyncIO secure channel with credentials.
 
     Args:
@@ -251,7 +252,7 @@
         default_scopes=default_scopes,
         ssl_credentials=ssl_credentials,
         quota_project_id=quota_project_id,
-        default_host=default_host
+        default_host=default_host,
     )
 
     return aio.secure_channel(target, composite_credentials, **kwargs)
diff --git a/google/api_core/iam.py b/google/api_core/iam.py
index c498c68..fc35469 100644
--- a/google/api_core/iam.py
+++ b/google/api_core/iam.py
@@ -450,10 +450,7 @@
             for binding in self._bindings:
                 members = binding.get("members")
                 if members:
-                    new_binding = {
-                        "role": binding["role"],
-                        "members": sorted(members)
-                    }
+                    new_binding = {"role": binding["role"], "members": sorted(members)}
                     condition = binding.get("condition")
                     if condition:
                         new_binding["condition"] = condition
diff --git a/google/api_core/operation.py b/google/api_core/operation.py
index a806523..b17f753 100644
--- a/google/api_core/operation.py
+++ b/google/api_core/operation.py
@@ -310,8 +310,12 @@
         ~.api_core.operation.Operation: The operation future to track the given
             operation.
     """
-    refresh = functools.partial(_refresh_grpc, operations_stub, operation.name, metadata=grpc_metadata)
-    cancel = functools.partial(_cancel_grpc, operations_stub, operation.name, metadata=grpc_metadata)
+    refresh = functools.partial(
+        _refresh_grpc, operations_stub, operation.name, metadata=grpc_metadata
+    )
+    cancel = functools.partial(
+        _cancel_grpc, operations_stub, operation.name, metadata=grpc_metadata
+    )
     return Operation(operation, refresh, cancel, result_type, **kwargs)
 
 
@@ -338,6 +342,10 @@
         ~.api_core.operation.Operation: The operation future to track the given
             operation.
     """
-    refresh = functools.partial(operations_client.get_operation, operation.name, metadata=grpc_metadata)
-    cancel = functools.partial(operations_client.cancel_operation, operation.name, metadata=grpc_metadata)
+    refresh = functools.partial(
+        operations_client.get_operation, operation.name, metadata=grpc_metadata
+    )
+    cancel = functools.partial(
+        operations_client.cancel_operation, operation.name, metadata=grpc_metadata
+    )
     return Operation(operation, refresh, cancel, result_type, **kwargs)
diff --git a/google/api_core/operation_async.py b/google/api_core/operation_async.py
index b137235..6bae865 100644
--- a/google/api_core/operation_async.py
+++ b/google/api_core/operation_async.py
@@ -212,6 +212,10 @@
         ~.api_core.operation.Operation: The operation future to track the given
             operation.
     """
-    refresh = functools.partial(operations_client.get_operation, operation.name, metadata=grpc_metadata)
-    cancel = functools.partial(operations_client.cancel_operation, operation.name, metadata=grpc_metadata)
+    refresh = functools.partial(
+        operations_client.get_operation, operation.name, metadata=grpc_metadata
+    )
+    cancel = functools.partial(
+        operations_client.cancel_operation, operation.name, metadata=grpc_metadata
+    )
     return AsyncOperation(operation, refresh, cancel, result_type, **kwargs)
diff --git a/google/api_core/operations_v1/operations_async_client.py b/google/api_core/operations_v1/operations_async_client.py
index b3d0135..5a5e556 100644
--- a/google/api_core/operations_v1/operations_async_client.py
+++ b/google/api_core/operations_v1/operations_async_client.py
@@ -125,7 +125,9 @@
         metadata = metadata or []
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
-        return await self._get_operation(request, retry=retry, timeout=timeout, metadata=metadata)
+        return await self._get_operation(
+            request, retry=retry, timeout=timeout, metadata=metadata
+        )
 
     async def list_operations(
         self,
@@ -192,7 +194,9 @@
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
         # Create the method used to fetch pages
-        method = functools.partial(self._list_operations, retry=retry, timeout=timeout, metadata=metadata)
+        method = functools.partial(
+            self._list_operations, retry=retry, timeout=timeout, metadata=metadata
+        )
 
         iterator = page_iterator_async.AsyncGRPCIterator(
             client=None,
@@ -260,7 +264,9 @@
         metadata = metadata or []
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
-        await self._cancel_operation(request, retry=retry, timeout=timeout, metadata=metadata)
+        await self._cancel_operation(
+            request, retry=retry, timeout=timeout, metadata=metadata
+        )
 
     async def delete_operation(
         self,
@@ -311,4 +317,6 @@
         metadata = metadata or []
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
-        await self._delete_operation(request, retry=retry, timeout=timeout, metadata=metadata)
+        await self._delete_operation(
+            request, retry=retry, timeout=timeout, metadata=metadata
+        )
diff --git a/google/api_core/operations_v1/operations_client.py b/google/api_core/operations_v1/operations_client.py
index b1218cf..e48eac0 100644
--- a/google/api_core/operations_v1/operations_client.py
+++ b/google/api_core/operations_v1/operations_client.py
@@ -139,7 +139,9 @@
         metadata = metadata or []
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
-        return self._get_operation(request, retry=retry, timeout=timeout, metadata=metadata)
+        return self._get_operation(
+            request, retry=retry, timeout=timeout, metadata=metadata
+        )
 
     def list_operations(
         self,
@@ -206,7 +208,9 @@
         metadata.append(gapic_v1.routing_header.to_grpc_metadata({"name": name}))
 
         # Create the method used to fetch pages
-        method = functools.partial(self._list_operations, retry=retry, timeout=timeout, metadata=metadata)
+        method = functools.partial(
+            self._list_operations, retry=retry, timeout=timeout, metadata=metadata
+        )
 
         iterator = page_iterator.GRPCIterator(
             client=None,
diff --git a/google/api_core/retry_async.py b/google/api_core/retry_async.py
index f925c3d..2dfa2f6 100644
--- a/google/api_core/retry_async.py
+++ b/google/api_core/retry_async.py
@@ -56,9 +56,12 @@
 import functools
 import logging
 
-from google.api_core import datetime_helpers, exceptions
-from google.api_core.retry import (exponential_sleep_generator,  # noqa: F401
-                                   if_exception_type, if_transient_error)
+from google.api_core import datetime_helpers
+from google.api_core import exceptions
+from google.api_core.retry import exponential_sleep_generator
+from google.api_core.retry import if_exception_type  # noqa: F401
+from google.api_core.retry import if_transient_error
+
 
 _LOGGER = logging.getLogger(__name__)
 _DEFAULT_INITIAL_DELAY = 1.0  # seconds
@@ -96,7 +99,11 @@
         ValueError: If the sleep generator stops yielding values.
         Exception: If the target raises a method that isn't retryable.
     """
-    deadline_dt = (datetime_helpers.utcnow() + datetime.timedelta(seconds=deadline)) if deadline else None
+    deadline_dt = (
+        (datetime_helpers.utcnow() + datetime.timedelta(seconds=deadline))
+        if deadline
+        else None
+    )
 
     last_exc = None
 
@@ -107,7 +114,7 @@
             else:
                 return await asyncio.wait_for(
                     target(),
-                    timeout=(deadline_dt - datetime_helpers.utcnow()).total_seconds()
+                    timeout=(deadline_dt - datetime_helpers.utcnow()).total_seconds(),
                 )
         # pylint: disable=broad-except
         # This function explicitly must deal with broad exceptions.
@@ -215,13 +222,15 @@
 
         return retry_wrapped_func
 
-    def _replace(self,
-                 predicate=None,
-                 initial=None,
-                 maximum=None,
-                 multiplier=None,
-                 deadline=None,
-                 on_error=None):
+    def _replace(
+        self,
+        predicate=None,
+        initial=None,
+        maximum=None,
+        multiplier=None,
+        deadline=None,
+        on_error=None,
+    ):
         return AsyncRetry(
             predicate=predicate or self._predicate,
             initial=initial or self._initial,
diff --git a/noxfile.py b/noxfile.py
index 650cef2..10a92ef 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -20,10 +20,18 @@
 # https://github.com/google/importlab/issues/25
 import nox  # pytype: disable=import-error
 
+
+BLACK_VERSION = "black==19.10b0"
+BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
+# Black and flake8 clash on the syntax for ignoring flake8's F401 in this file.
+BLACK_EXCLUDES = ["--exclude", "^/google/api_core/operations_v1/__init__.py"]
+
+DEFAULT_PYTHON_VERSION = "3.7"
 CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
 
 _MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6]
 
+
 def _greater_or_equal_than_36(version_string):
     tokens = version_string.split(".")
     for i, token in enumerate(tokens):
@@ -34,6 +42,31 @@
     return tokens >= [3, 6]
 
 
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def lint(session):
+    """Run linters.
+
+    Returns a failure if the linters find linting errors or sufficiently
+    serious code quality issues.
+    """
+    session.install("flake8", "flake8-import-order", BLACK_VERSION)
+    session.install(".")
+    session.run(
+        "black", "--check", *BLACK_EXCLUDES, *BLACK_PATHS,
+    )
+    session.run("flake8", "google", "tests")
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def blacken(session):
+    """Run black.
+
+    Format code to uniform standard.
+    """
+    session.install(BLACK_VERSION)
+    session.run("black", *BLACK_EXCLUDES, *BLACK_PATHS)
+
+
 def default(session):
     """Default unit test session.
 
@@ -96,18 +129,6 @@
 
 
 @nox.session(python="3.6")
-def lint(session):
-    """Run linters.
-
-    Returns a failure if the linters find linting errors or sufficiently
-    serious code quality issues.
-    """
-    session.install("flake8", "flake8-import-order")
-    session.install(".")
-    session.run("flake8", "google", "tests")
-
-
-@nox.session(python="3.6")
 def lint_setup_py(session):
     """Verify that setup.py is valid (including RST check)."""
 
diff --git a/owlbot.py b/owlbot.py
index 2a525c8..5c590e4 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -14,8 +14,6 @@
 
 """This script is used to synthesize generated parts of this library."""
 
-import re
-
 import synthtool as s
 from synthtool import gcp
 
@@ -38,3 +36,5 @@
 .pytype
 """,
 )
+
+s.shell.run(["nox", "-s", "blacken"], hide_output=False)
diff --git a/testing/constraints-2.7.txt b/testing/constraints-2.7.txt
index e69de29..246c89d 100644
--- a/testing/constraints-2.7.txt
+++ b/testing/constraints-2.7.txt
@@ -0,0 +1 @@
+googleapis-common-protos >= 1.6.0, < 1.53dev
diff --git a/tests/asyncio/future/test_async_future.py b/tests/asyncio/future/test_async_future.py
index 3322cb0..1e9ae33 100644
--- a/tests/asyncio/future/test_async_future.py
+++ b/tests/asyncio/future/test_async_future.py
@@ -125,7 +125,6 @@
 
 
 class AsyncFutureTimeout(AsyncFutureWithPoll):
-
     async def done(self):
         await asyncio.sleep(0.2)
         return False
diff --git a/tests/asyncio/gapic/test_method_async.py b/tests/asyncio/gapic/test_method_async.py
index 7318362..2c6bbab 100644
--- a/tests/asyncio/gapic/test_method_async.py
+++ b/tests/asyncio/gapic/test_method_async.py
@@ -18,8 +18,11 @@
 import mock
 import pytest
 
-from google.api_core import (exceptions, gapic_v1, grpc_helpers_async,
-                             retry_async, timeout)
+from google.api_core import exceptions
+from google.api_core import gapic_v1
+from google.api_core import grpc_helpers_async
+from google.api_core import retry_async
+from google.api_core import timeout
 
 
 def _utcnow_monotonic():
@@ -55,9 +58,7 @@
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall()
     method = mock.Mock(spec=aio.UnaryUnaryMultiCallable, return_value=fake_call)
 
-    wrapped_method = gapic_v1.method_async.wrap_method(
-        method, client_info=None
-    )
+    wrapped_method = gapic_v1.method_async.wrap_method(method, client_info=None)
 
     await wrapped_method(1, 2, meep="moop")
 
@@ -76,9 +77,7 @@
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall()
     method = mock.Mock(spec=aio.UnaryUnaryMultiCallable, return_value=fake_call)
 
-    wrapped_method = gapic_v1.method_async.wrap_method(
-        method, client_info=client_info
-    )
+    wrapped_method = gapic_v1.method_async.wrap_method(method, client_info=client_info)
 
     await wrapped_method(1, 2, meep="moop")
 
@@ -125,10 +124,10 @@
 @pytest.mark.asyncio
 async def test_wrap_method_with_default_retry_and_timeout(unused_sleep):
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall(42)
-    method = mock.Mock(spec=aio.UnaryUnaryMultiCallable, side_effect=[
-        exceptions.InternalServerError(None),
-        fake_call,
-    ])
+    method = mock.Mock(
+        spec=aio.UnaryUnaryMultiCallable,
+        side_effect=[exceptions.InternalServerError(None), fake_call],
+    )
 
     default_retry = retry_async.AsyncRetry()
     default_timeout = timeout.ConstantTimeout(60)
@@ -147,10 +146,10 @@
 @pytest.mark.asyncio
 async def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unused_sleep):
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall(42)
-    method = mock.Mock(spec=aio.UnaryUnaryMultiCallable, side_effect=[
-        exceptions.InternalServerError(None),
-        fake_call,
-    ])
+    method = mock.Mock(
+        spec=aio.UnaryUnaryMultiCallable,
+        side_effect=[exceptions.InternalServerError(None), fake_call],
+    )
 
     default_retry = retry_async.AsyncRetry()
     default_timeout = timeout.ConstantTimeout(60)
@@ -159,8 +158,7 @@
     )
 
     result = await wrapped_method(
-        retry=gapic_v1.method_async.DEFAULT,
-        timeout=gapic_v1.method_async.DEFAULT,
+        retry=gapic_v1.method_async.DEFAULT, timeout=gapic_v1.method_async.DEFAULT,
     )
 
     assert result == 42
@@ -172,10 +170,10 @@
 @pytest.mark.asyncio
 async def test_wrap_method_with_overriding_retry_and_timeout(unused_sleep):
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall(42)
-    method = mock.Mock(spec=aio.UnaryUnaryMultiCallable, side_effect=[
-        exceptions.NotFound(None),
-        fake_call,
-    ])
+    method = mock.Mock(
+        spec=aio.UnaryUnaryMultiCallable,
+        side_effect=[exceptions.NotFound(None), fake_call],
+    )
 
     default_retry = retry_async.AsyncRetry()
     default_timeout = timeout.ConstantTimeout(60)
@@ -184,7 +182,9 @@
     )
 
     result = await wrapped_method(
-        retry=retry_async.AsyncRetry(retry_async.if_exception_type(exceptions.NotFound)),
+        retry=retry_async.AsyncRetry(
+            retry_async.if_exception_type(exceptions.NotFound)
+        ),
         timeout=timeout.ConstantTimeout(22),
     )
 
@@ -204,7 +204,8 @@
     fake_call = grpc_helpers_async.FakeUnaryUnaryCall(42)
     method = mock.Mock(
         spec=aio.UnaryUnaryMultiCallable,
-        side_effect=([exceptions.InternalServerError(None)] * 4) + [fake_call])
+        side_effect=([exceptions.InternalServerError(None)] * 4) + [fake_call],
+    )
 
     default_retry = retry_async.AsyncRetry()
     default_timeout = timeout.ExponentialTimeout(deadline=60)
diff --git a/tests/asyncio/operations_v1/test_operations_async_client.py b/tests/asyncio/operations_v1/test_operations_async_client.py
index a646901..5473e8a 100644
--- a/tests/asyncio/operations_v1/test_operations_async_client.py
+++ b/tests/asyncio/operations_v1/test_operations_async_client.py
@@ -16,8 +16,7 @@
 import mock
 import pytest
 
-from google.api_core import (grpc_helpers_async, operations_v1,
-                             page_iterator_async)
+from google.api_core import grpc_helpers_async, operations_v1, page_iterator_async
 from google.longrunning import operations_pb2
 from google.protobuf import empty_pb2
 
@@ -33,14 +32,17 @@
 @pytest.mark.asyncio
 async def test_get_operation():
     mocked_channel, method, fake_call = _mock_grpc_objects(
-        operations_pb2.Operation(name="meep"))
+        operations_pb2.Operation(name="meep")
+    )
     client = operations_v1.OperationsAsyncClient(mocked_channel)
 
     response = await client.get_operation("name", metadata=[("header", "foo")])
     assert method.call_count == 1
     assert tuple(method.call_args_list[0])[0][0].name == "name"
     assert ("header", "foo") in tuple(method.call_args_list[0])[1]["metadata"]
-    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1]["metadata"]
+    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1][
+        "metadata"
+    ]
     assert response == fake_call.response
 
 
@@ -66,7 +68,9 @@
 
     assert method.call_count == 1
     assert ("header", "foo") in tuple(method.call_args_list[0])[1]["metadata"]
-    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1]["metadata"]
+    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1][
+        "metadata"
+    ]
     request = tuple(method.call_args_list[0])[0][0]
     assert isinstance(request, operations_pb2.ListOperationsRequest)
     assert request.name == "name"
@@ -75,8 +79,7 @@
 
 @pytest.mark.asyncio
 async def test_delete_operation():
-    mocked_channel, method, fake_call = _mock_grpc_objects(
-        empty_pb2.Empty())
+    mocked_channel, method, fake_call = _mock_grpc_objects(empty_pb2.Empty())
     client = operations_v1.OperationsAsyncClient(mocked_channel)
 
     await client.delete_operation("name", metadata=[("header", "foo")])
@@ -84,13 +87,14 @@
     assert method.call_count == 1
     assert tuple(method.call_args_list[0])[0][0].name == "name"
     assert ("header", "foo") in tuple(method.call_args_list[0])[1]["metadata"]
-    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1]["metadata"]
+    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1][
+        "metadata"
+    ]
 
 
 @pytest.mark.asyncio
 async def test_cancel_operation():
-    mocked_channel, method, fake_call = _mock_grpc_objects(
-        empty_pb2.Empty())
+    mocked_channel, method, fake_call = _mock_grpc_objects(empty_pb2.Empty())
     client = operations_v1.OperationsAsyncClient(mocked_channel)
 
     await client.cancel_operation("name", metadata=[("header", "foo")])
@@ -98,4 +102,6 @@
     assert method.call_count == 1
     assert tuple(method.call_args_list[0])[0][0].name == "name"
     assert ("header", "foo") in tuple(method.call_args_list[0])[1]["metadata"]
-    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1]["metadata"]
+    assert ("x-goog-request-params", "name=name") in tuple(method.call_args_list[0])[1][
+        "metadata"
+    ]
diff --git a/tests/asyncio/test_grpc_helpers_async.py b/tests/asyncio/test_grpc_helpers_async.py
index 868018c..a511ed4 100644
--- a/tests/asyncio/test_grpc_helpers_async.py
+++ b/tests/asyncio/test_grpc_helpers_async.py
@@ -170,8 +170,10 @@
     grpc_error = RpcErrorImpl(grpc.StatusCode.INVALID_ARGUMENT)
 
     mock_call = mock.Mock(aio.StreamStreamCall, autospec=True)
-    mocked_aiter = mock.Mock(spec=['__anext__'])
-    mocked_aiter.__anext__ = mock.AsyncMock(side_effect=[mock.sentinel.response, grpc_error])
+    mocked_aiter = mock.Mock(spec=["__anext__"])
+    mocked_aiter.__anext__ = mock.AsyncMock(
+        side_effect=[mock.sentinel.response, grpc_error]
+    )
     mock_call.__aiter__ = mock.Mock(return_value=mocked_aiter)
     multicallable = mock.Mock(return_value=mock_call)
 
@@ -186,11 +188,13 @@
 
 @pytest.mark.asyncio
 async def test_wrap_stream_errors_aiter_non_rpc_error():
-    non_grpc_error = TypeError('Not a gRPC error')
+    non_grpc_error = TypeError("Not a gRPC error")
 
     mock_call = mock.Mock(aio.StreamStreamCall, autospec=True)
-    mocked_aiter = mock.Mock(spec=['__anext__'])
-    mocked_aiter.__anext__ = mock.AsyncMock(side_effect=[mock.sentinel.response, non_grpc_error])
+    mocked_aiter = mock.Mock(spec=["__anext__"])
+    mocked_aiter.__anext__ = mock.AsyncMock(
+        side_effect=[mock.sentinel.response, non_grpc_error]
+    )
     mock_call.__aiter__ = mock.Mock(return_value=mocked_aiter)
     multicallable = mock.Mock(return_value=mock_call)
 
@@ -283,7 +287,7 @@
 @mock.patch(
     "google.auth.transport.requests.Request",
     autospec=True,
-    return_value=mock.sentinel.Request
+    return_value=mock.sentinel.Request,
 )
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch(
@@ -292,7 +296,9 @@
     return_value=(mock.sentinel.credentials, mock.sentinel.projet),
 )
 @mock.patch("grpc.experimental.aio.secure_channel")
-def test_create_channel_implicit_with_default_host(grpc_secure_channel, default, composite_creds_call, request, auth_metadata_plugin):
+def test_create_channel_implicit_with_default_host(
+    grpc_secure_channel, default, composite_creds_call, request, auth_metadata_plugin
+):
     target = "example.com:443"
     default_host = "example.com"
     composite_creds = composite_creds_call.return_value
@@ -302,7 +308,9 @@
     assert channel is grpc_secure_channel.return_value
 
     default.assert_called_once_with(scopes=None, default_scopes=None)
-    auth_metadata_plugin.assert_called_once_with(mock.sentinel.credentials, mock.sentinel.Request, default_host=default_host)
+    auth_metadata_plugin.assert_called_once_with(
+        mock.sentinel.credentials, mock.sentinel.Request, default_host=default_host
+    )
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
 
@@ -361,7 +369,9 @@
     target = "example.com:443"
     composite_creds = composite_creds_call.return_value
 
-    channel = grpc_helpers_async.create_channel(target, default_scopes=["three", "four"])
+    channel = grpc_helpers_async.create_channel(
+        target, default_scopes=["three", "four"]
+    )
 
     assert channel is grpc_secure_channel.return_value
 
@@ -376,7 +386,7 @@
         grpc_helpers_async.create_channel(
             target,
             credentials_file="credentials.json",
-            credentials=mock.sentinel.credentials
+            credentials=mock.sentinel.credentials,
         )
 
     assert "mutually exclusive" in str(excinfo.value)
@@ -389,9 +399,13 @@
     target = "example.com:443"
     composite_creds = composite_creds_call.return_value
 
-    channel = grpc_helpers_async.create_channel(target, credentials=mock.sentinel.credentials)
+    channel = grpc_helpers_async.create_channel(
+        target, credentials=mock.sentinel.credentials
+    )
 
-    auth_creds.assert_called_once_with(mock.sentinel.credentials, scopes=None, default_scopes=None)
+    auth_creds.assert_called_once_with(
+        mock.sentinel.credentials, scopes=None, default_scopes=None
+    )
     assert channel is grpc_secure_channel.return_value
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
@@ -417,7 +431,9 @@
 
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch("grpc.experimental.aio.secure_channel")
-def test_create_channel_explicit_default_scopes(grpc_secure_channel, composite_creds_call):
+def test_create_channel_explicit_default_scopes(
+    grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     default_scopes = ["3", "4"]
     composite_creds = composite_creds_call.return_value
@@ -429,18 +445,24 @@
         target, credentials=credentials, default_scopes=default_scopes
     )
 
-    credentials.with_scopes.assert_called_once_with(scopes=None, default_scopes=default_scopes)
+    credentials.with_scopes.assert_called_once_with(
+        scopes=None, default_scopes=default_scopes
+    )
     assert channel is grpc_secure_channel.return_value
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
 
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch("grpc.experimental.aio.secure_channel")
-def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composite_creds_call):
+def test_create_channel_explicit_with_quota_project(
+    grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     composite_creds = composite_creds_call.return_value
 
-    credentials = mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject, instance=True)
+    credentials = mock.create_autospec(
+        google.auth.credentials.CredentialsWithQuotaProject, instance=True
+    )
 
     channel = grpc_helpers_async.create_channel(
         target, credentials=credentials, quota_project_id="project-foo"
@@ -456,9 +478,11 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channnel_with_credentials_file(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channnel_with_credentials_file(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
 
     credentials_file = "/path/to/credentials/file.json"
@@ -468,7 +492,9 @@
         target, credentials_file=credentials_file
     )
 
-    google.auth.load_credentials_from_file.assert_called_once_with(credentials_file, scopes=None, default_scopes=None)
+    google.auth.load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=None, default_scopes=None
+    )
     assert channel is grpc_secure_channel.return_value
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
@@ -478,9 +504,11 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channel_with_credentials_file_and_scopes(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channel_with_credentials_file_and_scopes(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     scopes = ["1", "2"]
 
@@ -491,7 +519,9 @@
         target, credentials_file=credentials_file, scopes=scopes
     )
 
-    google.auth.load_credentials_from_file.assert_called_once_with(credentials_file, scopes=scopes, default_scopes=None)
+    google.auth.load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=scopes, default_scopes=None
+    )
     assert channel is grpc_secure_channel.return_value
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
@@ -501,9 +531,11 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channel_with_credentials_file_and_default_scopes(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channel_with_credentials_file_and_default_scopes(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     default_scopes = ["3", "4"]
 
@@ -514,12 +546,16 @@
         target, credentials_file=credentials_file, default_scopes=default_scopes
     )
 
-    google.auth.load_credentials_from_file.assert_called_once_with(credentials_file, scopes=None, default_scopes=default_scopes)
+    google.auth.load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=None, default_scopes=default_scopes
+    )
     assert channel is grpc_secure_channel.return_value
     grpc_secure_channel.assert_called_once_with(target, composite_creds)
 
 
-@pytest.mark.skipif(grpc_helpers_async.HAS_GRPC_GCP, reason="grpc_gcp module not available")
+@pytest.mark.skipif(
+    grpc_helpers_async.HAS_GRPC_GCP, reason="grpc_gcp module not available"
+)
 @mock.patch("grpc.experimental.aio.secure_channel")
 def test_create_channel_without_grpc_gcp(grpc_secure_channel):
     target = "example.com:443"
diff --git a/tests/asyncio/test_operation_async.py b/tests/asyncio/test_operation_async.py
index e35d139..907cda7 100644
--- a/tests/asyncio/test_operation_async.py
+++ b/tests/asyncio/test_operation_async.py
@@ -177,15 +177,15 @@
         operations_client,
         struct_pb2.Struct,
         metadata_type=struct_pb2.Struct,
-        grpc_metadata=[('x-goog-request-params', 'foo')]
+        grpc_metadata=[("x-goog-request-params", "foo")],
     )
 
     assert future._result_type == struct_pb2.Struct
     assert future._metadata_type == struct_pb2.Struct
     assert future.operation.name == TEST_OPERATION_NAME
     assert future.done
-    assert future._refresh.keywords["metadata"] == [('x-goog-request-params', 'foo')]
-    assert future._cancel.keywords["metadata"] == [('x-goog-request-params', 'foo')]
+    assert future._refresh.keywords["metadata"] == [("x-goog-request-params", "foo")]
+    assert future._cancel.keywords["metadata"] == [("x-goog-request-params", "foo")]
 
 
 def test_deserialize():
diff --git a/tests/asyncio/test_page_iterator_async.py b/tests/asyncio/test_page_iterator_async.py
index 4abacc6..75f9e1c 100644
--- a/tests/asyncio/test_page_iterator_async.py
+++ b/tests/asyncio/test_page_iterator_async.py
@@ -21,13 +21,11 @@
 
 
 class PageAsyncIteratorImpl(page_iterator_async.AsyncIterator):
-
     async def _next_page(self):
         return mock.create_autospec(page_iterator_async.Page, instance=True)
 
 
 class TestAsyncIterator:
-
     def test_constructor(self):
         client = mock.sentinel.client
         item_to_value = mock.sentinel.item_to_value
@@ -51,7 +49,9 @@
     async def test_anext(self):
         parent = mock.sentinel.parent
         page_1 = page_iterator_async.Page(
-            parent, ("item 1.1", "item 1.2"), page_iterator_async._item_to_value_identity
+            parent,
+            ("item 1.1", "item 1.2"),
+            page_iterator_async._item_to_value_identity,
         )
         page_2 = page_iterator_async.Page(
             parent, ("item 2.1",), page_iterator_async._item_to_value_identity
@@ -96,7 +96,8 @@
     async def test__page_aiter_increment(self):
         iterator = PageAsyncIteratorImpl(None, None)
         page = page_iterator_async.Page(
-            iterator, ("item",), page_iterator_async._item_to_value_identity)
+            iterator, ("item",), page_iterator_async._item_to_value_identity
+        )
         iterator._next_page = mock.AsyncMock(side_effect=[page, None])
 
         assert iterator.num_results == 0
@@ -128,9 +129,11 @@
         # Make pages from mock responses
         parent = mock.sentinel.parent
         page1 = page_iterator_async.Page(
-            parent, (item1, item2), page_iterator_async._item_to_value_identity)
+            parent, (item1, item2), page_iterator_async._item_to_value_identity
+        )
         page2 = page_iterator_async.Page(
-            parent, (item3,), page_iterator_async._item_to_value_identity)
+            parent, (item3,), page_iterator_async._item_to_value_identity
+        )
 
         iterator = PageAsyncIteratorImpl(None, None)
         iterator._next_page = mock.AsyncMock(side_effect=[page1, page2, None])
@@ -187,7 +190,6 @@
 
 
 class TestAsyncGRPCIterator(object):
-
     def test_constructor(self):
         client = mock.sentinel.client
         items_field = "items"
diff --git a/tests/asyncio/test_retry_async.py b/tests/asyncio/test_retry_async.py
index 8f86366..9e51044 100644
--- a/tests/asyncio/test_retry_async.py
+++ b/tests/asyncio/test_retry_async.py
@@ -66,7 +66,9 @@
 
     on_error = mock.Mock()
 
-    result = await retry_async.retry_target(target, predicate, range(10), None, on_error=on_error)
+    result = await retry_async.retry_target(
+        target, predicate, range(10), None, on_error=on_error
+    )
 
     assert result == 42
     assert call_count["target"] == 3
@@ -122,11 +124,12 @@
 @pytest.mark.asyncio
 async def test_retry_target_bad_sleep_generator():
     with pytest.raises(ValueError, match="Sleep generator"):
-        await retry_async.retry_target(mock.sentinel.target, mock.sentinel.predicate, [], None)
+        await retry_async.retry_target(
+            mock.sentinel.target, mock.sentinel.predicate, [], None
+        )
 
 
 class TestAsyncRetry:
-
     def test_constructor_defaults(self):
         retry_ = retry_async.AsyncRetry()
         assert retry_._predicate == retry_async.if_transient_error
@@ -276,7 +279,9 @@
     async def test___call___and_execute_retry(self, sleep, uniform):
 
         on_error = mock.Mock(spec=["__call__"], side_effect=[None])
-        retry_ = retry_async.AsyncRetry(predicate=retry_async.if_exception_type(ValueError))
+        retry_ = retry_async.AsyncRetry(
+            predicate=retry_async.if_exception_type(ValueError)
+        )
 
         target = mock.AsyncMock(spec=["__call__"], side_effect=[ValueError(), 42])
         # __name__ is needed by functools.partial.
@@ -325,6 +330,7 @@
             # time clock.
             def increase_time(sleep_delay):
                 patched_utcnow.return_value += datetime.timedelta(seconds=sleep_delay)
+
             sleep.side_effect = increase_time
 
             with pytest.raises(exceptions.RetryError):
@@ -339,7 +345,7 @@
         last_wait = sleep.call_args.args[0]
         total_wait = sum(call_args.args[0] for call_args in sleep.call_args_list)
 
-        assert last_wait == 2.9   # and not 8.0, because the last delay was shortened
+        assert last_wait == 2.9  # and not 8.0, because the last delay was shortened
         assert total_wait == 9.9  # the same as the deadline
 
     @mock.patch("asyncio.sleep", autospec=True)
diff --git a/tests/unit/gapic/test_method.py b/tests/unit/gapic/test_method.py
index 1ae27de..e0ea57a 100644
--- a/tests/unit/gapic/test_method.py
+++ b/tests/unit/gapic/test_method.py
@@ -175,8 +175,7 @@
 
 @mock.patch("time.sleep")
 def test_wrap_method_with_overriding_retry_and_timeout(unusued_sleep):
-    method = mock.Mock(spec=["__call__"], side_effect=[
-                       exceptions.NotFound(None), 42])
+    method = mock.Mock(spec=["__call__"], side_effect=[exceptions.NotFound(None), 42])
     default_retry = retry.Retry()
     default_timeout = timeout.ConstantTimeout(60)
     wrapped_method = google.api_core.gapic_v1.method.wrap_method(
diff --git a/tests/unit/operations_v1/test_operations_client.py b/tests/unit/operations_v1/test_operations_client.py
index ed19b7f..001b8fe 100644
--- a/tests/unit/operations_v1/test_operations_client.py
+++ b/tests/unit/operations_v1/test_operations_client.py
@@ -27,7 +27,9 @@
     response = client.get_operation("name", metadata=[("header", "foo")])
 
     assert ("header", "foo") in channel.GetOperation.calls[0].metadata
-    assert ("x-goog-request-params", "name=name") in channel.GetOperation.calls[0].metadata
+    assert ("x-goog-request-params", "name=name") in channel.GetOperation.calls[
+        0
+    ].metadata
     assert len(channel.GetOperation.requests) == 1
     assert channel.GetOperation.requests[0].name == "name"
     assert response == channel.GetOperation.response
@@ -49,7 +51,9 @@
     assert list(response) == operations
 
     assert ("header", "foo") in channel.ListOperations.calls[0].metadata
-    assert ("x-goog-request-params", "name=name") in channel.ListOperations.calls[0].metadata
+    assert ("x-goog-request-params", "name=name") in channel.ListOperations.calls[
+        0
+    ].metadata
     assert len(channel.ListOperations.requests) == 1
     request = channel.ListOperations.requests[0]
     assert isinstance(request, operations_pb2.ListOperationsRequest)
@@ -65,7 +69,9 @@
     client.delete_operation("name", metadata=[("header", "foo")])
 
     assert ("header", "foo") in channel.DeleteOperation.calls[0].metadata
-    assert ("x-goog-request-params", "name=name") in channel.DeleteOperation.calls[0].metadata
+    assert ("x-goog-request-params", "name=name") in channel.DeleteOperation.calls[
+        0
+    ].metadata
     assert len(channel.DeleteOperation.requests) == 1
     assert channel.DeleteOperation.requests[0].name == "name"
 
@@ -78,6 +84,8 @@
     client.cancel_operation("name", metadata=[("header", "foo")])
 
     assert ("header", "foo") in channel.CancelOperation.calls[0].metadata
-    assert ("x-goog-request-params", "name=name") in channel.CancelOperation.calls[0].metadata
+    assert ("x-goog-request-params", "name=name") in channel.CancelOperation.calls[
+        0
+    ].metadata
     assert len(channel.CancelOperation.requests) == 1
     assert channel.CancelOperation.requests[0].name == "name"
diff --git a/tests/unit/test_bidi.py b/tests/unit/test_bidi.py
index 52215cb..602d640 100644
--- a/tests/unit/test_bidi.py
+++ b/tests/unit/test_bidi.py
@@ -121,21 +121,18 @@
     def test_repr(self):
         delta = datetime.timedelta(seconds=4.5)
         instance = bidi._Throttle(access_limit=42, time_window=delta)
-        assert repr(instance) == \
-            "_Throttle(access_limit=42, time_window={})".format(repr(delta))
+        assert repr(instance) == "_Throttle(access_limit=42, time_window={})".format(
+            repr(delta)
+        )
 
     def test_raises_error_on_invalid_init_arguments(self):
         with pytest.raises(ValueError) as exc_info:
-            bidi._Throttle(
-                access_limit=10, time_window=datetime.timedelta(seconds=0.0)
-            )
+            bidi._Throttle(access_limit=10, time_window=datetime.timedelta(seconds=0.0))
         assert "time_window" in str(exc_info.value)
         assert "must be a positive timedelta" in str(exc_info.value)
 
         with pytest.raises(ValueError) as exc_info:
-            bidi._Throttle(
-                access_limit=0, time_window=datetime.timedelta(seconds=10)
-            )
+            bidi._Throttle(access_limit=0, time_window=datetime.timedelta(seconds=10))
         assert "access_limit" in str(exc_info.value)
         assert "must be positive" in str(exc_info.value)
 
@@ -461,7 +458,9 @@
         )
         should_recover = mock.Mock(spec=["__call__"], return_value=False)
         should_terminate = mock.Mock(spec=["__call__"], return_value=True)
-        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, should_terminate=should_terminate)
+        bidi_rpc = bidi.ResumableBidiRpc(
+            start_rpc, should_recover, should_terminate=should_terminate
+        )
 
         bidi_rpc.open()
 
@@ -527,7 +526,9 @@
         )
         should_recover = mock.Mock(spec=["__call__"], return_value=False)
         should_terminate = mock.Mock(spec=["__call__"], return_value=True)
-        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, should_terminate=should_terminate)
+        bidi_rpc = bidi.ResumableBidiRpc(
+            start_rpc, should_recover, should_terminate=should_terminate
+        )
 
         bidi_rpc.open()
 
diff --git a/tests/unit/test_client_options.py b/tests/unit/test_client_options.py
index 1581c56..38b9ad0 100644
--- a/tests/unit/test_client_options.py
+++ b/tests/unit/test_client_options.py
@@ -35,7 +35,7 @@
         scopes=[
             "https://www.googleapis.com/auth/cloud-platform",
             "https://www.googleapis.com/auth/cloud-platform.read-only",
-        ]
+        ],
     )
 
     assert options.api_endpoint == "foo.googleapis.com"
@@ -82,7 +82,7 @@
             "scopes": [
                 "https://www.googleapis.com/auth/cloud-platform",
                 "https://www.googleapis.com/auth/cloud-platform.read-only",
-            ]
+            ],
         }
     )
 
diff --git a/tests/unit/test_grpc_helpers.py b/tests/unit/test_grpc_helpers.py
index 8c6202b..12bf184 100644
--- a/tests/unit/test_grpc_helpers.py
+++ b/tests/unit/test_grpc_helpers.py
@@ -246,7 +246,7 @@
 @mock.patch(
     "google.auth.transport.requests.Request",
     autospec=True,
-    return_value=mock.sentinel.Request
+    return_value=mock.sentinel.Request,
 )
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch(
@@ -255,7 +255,9 @@
     return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
 @mock.patch("grpc.secure_channel")
-def test_create_channel_implicit_with_default_host(grpc_secure_channel, default, composite_creds_call, request, auth_metadata_plugin):
+def test_create_channel_implicit_with_default_host(
+    grpc_secure_channel, default, composite_creds_call, request, auth_metadata_plugin
+):
     target = "example.com:443"
     default_host = "example.com"
     composite_creds = composite_creds_call.return_value
@@ -265,7 +267,9 @@
     assert channel is grpc_secure_channel.return_value
 
     default.assert_called_once_with(scopes=None, default_scopes=None)
-    auth_metadata_plugin.assert_called_once_with(mock.sentinel.credentials, mock.sentinel.Request, default_host=default_host)
+    auth_metadata_plugin.assert_called_once_with(
+        mock.sentinel.credentials, mock.sentinel.Request, default_host=default_host
+    )
 
     if grpc_helpers.HAS_GRPC_GCP:
         grpc_secure_channel.assert_called_once_with(target, composite_creds, None)
@@ -356,7 +360,7 @@
         grpc_helpers.create_channel(
             target,
             credentials_file="credentials.json",
-            credentials=mock.sentinel.credentials
+            credentials=mock.sentinel.credentials,
         )
 
 
@@ -369,7 +373,9 @@
 
     channel = grpc_helpers.create_channel(target, credentials=mock.sentinel.credentials)
 
-    auth_creds.assert_called_once_with(mock.sentinel.credentials, scopes=None, default_scopes=None)
+    auth_creds.assert_called_once_with(
+        mock.sentinel.credentials, scopes=None, default_scopes=None
+    )
 
     assert channel is grpc_secure_channel.return_value
     if grpc_helpers.HAS_GRPC_GCP:
@@ -403,7 +409,9 @@
 
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch("grpc.secure_channel")
-def test_create_channel_explicit_default_scopes(grpc_secure_channel, composite_creds_call):
+def test_create_channel_explicit_default_scopes(
+    grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     default_scopes = ["3", "4"]
     composite_creds = composite_creds_call.return_value
@@ -415,7 +423,9 @@
         target, credentials=credentials, default_scopes=default_scopes
     )
 
-    credentials.with_scopes.assert_called_once_with(scopes=None, default_scopes=default_scopes)
+    credentials.with_scopes.assert_called_once_with(
+        scopes=None, default_scopes=default_scopes
+    )
 
     assert channel is grpc_secure_channel.return_value
     if grpc_helpers.HAS_GRPC_GCP:
@@ -426,16 +436,18 @@
 
 @mock.patch("grpc.composite_channel_credentials")
 @mock.patch("grpc.secure_channel")
-def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composite_creds_call):
+def test_create_channel_explicit_with_quota_project(
+    grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     composite_creds = composite_creds_call.return_value
 
-    credentials = mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject, instance=True)
+    credentials = mock.create_autospec(
+        google.auth.credentials.CredentialsWithQuotaProject, instance=True
+    )
 
     channel = grpc_helpers.create_channel(
-        target,
-        credentials=credentials,
-        quota_project_id="project-foo"
+        target, credentials=credentials, quota_project_id="project-foo"
     )
 
     credentials.with_quota_project.assert_called_once_with("project-foo")
@@ -452,19 +464,21 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channel_with_credentials_file(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channel_with_credentials_file(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
 
     credentials_file = "/path/to/credentials/file.json"
     composite_creds = composite_creds_call.return_value
 
-    channel = grpc_helpers.create_channel(
-        target, credentials_file=credentials_file
-    )
+    channel = grpc_helpers.create_channel(target, credentials_file=credentials_file)
 
-    google.auth.load_credentials_from_file.assert_called_once_with(credentials_file, scopes=None, default_scopes=None)
+    google.auth.load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=None, default_scopes=None
+    )
 
     assert channel is grpc_secure_channel.return_value
     if grpc_helpers.HAS_GRPC_GCP:
@@ -478,9 +492,11 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channel_with_credentials_file_and_scopes(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channel_with_credentials_file_and_scopes(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     scopes = ["1", "2"]
 
@@ -491,7 +507,9 @@
         target, credentials_file=credentials_file, scopes=scopes
     )
 
-    google.auth.load_credentials_from_file.assert_called_once_with(credentials_file, scopes=scopes, default_scopes=None)
+    google.auth.load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=scopes, default_scopes=None
+    )
 
     assert channel is grpc_secure_channel.return_value
     if grpc_helpers.HAS_GRPC_GCP:
@@ -505,9 +523,11 @@
 @mock.patch(
     "google.auth.load_credentials_from_file",
     autospec=True,
-    return_value=(mock.sentinel.credentials, mock.sentinel.project)
+    return_value=(mock.sentinel.credentials, mock.sentinel.project),
 )
-def test_create_channel_with_credentials_file_and_default_scopes(load_credentials_from_file, grpc_secure_channel, composite_creds_call):
+def test_create_channel_with_credentials_file_and_default_scopes(
+    load_credentials_from_file, grpc_secure_channel, composite_creds_call
+):
     target = "example.com:443"
     default_scopes = ["3", "4"]
 
@@ -518,7 +538,9 @@
         target, credentials_file=credentials_file, default_scopes=default_scopes
     )
 
-    load_credentials_from_file.assert_called_once_with(credentials_file, scopes=None, default_scopes=default_scopes)
+    load_credentials_from_file.assert_called_once_with(
+        credentials_file, scopes=None, default_scopes=default_scopes
+    )
 
     assert channel is grpc_secure_channel.return_value
     if grpc_helpers.HAS_GRPC_GCP:
diff --git a/tests/unit/test_iam.py b/tests/unit/test_iam.py
index 0da9b23..e783533 100644
--- a/tests/unit/test_iam.py
+++ b/tests/unit/test_iam.py
@@ -57,6 +57,7 @@
 
     def test__getitem___and_set(self):
         from google.api_core.iam import OWNER_ROLE
+
         policy = self._make_one()
 
         # get the policy using the getter and then modify it
@@ -120,7 +121,7 @@
         policy = self._make_one()
         policy.bindings = [
             {"role": "to/keep", "members": set(["phred@example.com"])},
-            {"role": "to/remove", "members": set(["phred@example.com"])}
+            {"role": "to/remove", "members": set(["phred@example.com"])},
         ]
         del policy["to/remove"]
         assert len(policy) == 1
@@ -150,7 +151,9 @@
         USER = "user:phred@example.com"
         CONDITION = {"expression": "2 > 1"}
         policy = self._make_one()
-        BINDINGS = [{"role": "role/reader", "members": set([USER]), "condition": CONDITION}]
+        BINDINGS = [
+            {"role": "role/reader", "members": set([USER]), "condition": CONDITION}
+        ]
         policy.bindings = BINDINGS
         assert policy.bindings == BINDINGS
 
@@ -394,13 +397,17 @@
         CONDITION = {
             "title": "title",
             "description": "description",
-            "expression": "true"
+            "expression": "true",
         }
         BINDINGS = [
             {"role": OWNER_ROLE, "members": [OWNER1, OWNER2]},
             {"role": EDITOR_ROLE, "members": [EDITOR1, EDITOR2]},
             {"role": VIEWER_ROLE, "members": [VIEWER1, VIEWER2]},
-            {"role": VIEWER_ROLE, "members": [VIEWER1, VIEWER2], "condition": CONDITION},
+            {
+                "role": VIEWER_ROLE,
+                "members": [VIEWER1, VIEWER2],
+                "condition": CONDITION,
+            },
         ]
         policy = self._make_one("DEADBEEF", 1)
         policy.bindings = BINDINGS
diff --git a/tests/unit/test_operation.py b/tests/unit/test_operation.py
index ae9bafe..28fbfe2 100644
--- a/tests/unit/test_operation.py
+++ b/tests/unit/test_operation.py
@@ -279,15 +279,15 @@
         operations_stub,
         struct_pb2.Struct,
         metadata_type=struct_pb2.Struct,
-        grpc_metadata=[('x-goog-request-params', 'foo')]
+        grpc_metadata=[("x-goog-request-params", "foo")],
     )
 
     assert future._result_type == struct_pb2.Struct
     assert future._metadata_type == struct_pb2.Struct
     assert future.operation.name == TEST_OPERATION_NAME
     assert future.done
-    assert future._refresh.keywords["metadata"] == [('x-goog-request-params', 'foo')]
-    assert future._cancel.keywords["metadata"] == [('x-goog-request-params', 'foo')]
+    assert future._refresh.keywords["metadata"] == [("x-goog-request-params", "foo")]
+    assert future._cancel.keywords["metadata"] == [("x-goog-request-params", "foo")]
 
 
 def test_from_gapic():
@@ -301,15 +301,15 @@
         operations_client,
         struct_pb2.Struct,
         metadata_type=struct_pb2.Struct,
-        grpc_metadata=[('x-goog-request-params', 'foo')]
+        grpc_metadata=[("x-goog-request-params", "foo")],
     )
 
     assert future._result_type == struct_pb2.Struct
     assert future._metadata_type == struct_pb2.Struct
     assert future.operation.name == TEST_OPERATION_NAME
     assert future.done
-    assert future._refresh.keywords["metadata"] == [('x-goog-request-params', 'foo')]
-    assert future._cancel.keywords["metadata"] == [('x-goog-request-params', 'foo')]
+    assert future._refresh.keywords["metadata"] == [("x-goog-request-params", "foo")]
+    assert future._cancel.keywords["metadata"] == [("x-goog-request-params", "foo")]
 
 
 def test_deserialize():
diff --git a/tests/unit/test_page_iterator.py b/tests/unit/test_page_iterator.py
index 97b0657..668cf39 100644
--- a/tests/unit/test_page_iterator.py
+++ b/tests/unit/test_page_iterator.py
@@ -150,7 +150,8 @@
     def test__page_iter_increment(self):
         iterator = PageIteratorImpl(None, None)
         page = page_iterator.Page(
-            iterator, ("item",), page_iterator._item_to_value_identity)
+            iterator, ("item",), page_iterator._item_to_value_identity
+        )
         iterator._next_page = mock.Mock(side_effect=[page, None])
 
         assert iterator.num_results == 0
@@ -180,9 +181,11 @@
         # Make pages from mock responses
         parent = mock.sentinel.parent
         page1 = page_iterator.Page(
-            parent, (item1, item2), page_iterator._item_to_value_identity)
+            parent, (item1, item2), page_iterator._item_to_value_identity
+        )
         page2 = page_iterator.Page(
-            parent, (item3,), page_iterator._item_to_value_identity)
+            parent, (item3,), page_iterator._item_to_value_identity
+        )
 
         iterator = PageIteratorImpl(None, None)
         iterator._next_page = mock.Mock(side_effect=[page1, page2, None])
@@ -456,7 +459,8 @@
 
     @pytest.mark.parametrize(
         "page_size,max_results,pages",
-        [(3, None, False), (3, 8, False), (3, None, True), (3, 8, True)])
+        [(3, None, False), (3, 8, False), (3, None, True), (3, 8, True)],
+    )
     def test_page_size_items(self, page_size, max_results, pages):
         path = "/foo"
         NITEMS = 10
@@ -467,19 +471,20 @@
             assert not args
             query_params = dict(
                 maxResults=(
-                    page_size if max_results is None
-                    else min(page_size, max_results - n[0]))
+                    page_size
+                    if max_results is None
+                    else min(page_size, max_results - n[0])
+                )
             )
             if n[0]:
-                query_params.update(pageToken='test')
-            assert kw == {'method': 'GET', 'path': '/foo',
-                          'query_params': query_params}
-            n_items = min(kw['query_params']['maxResults'], NITEMS - n[0])
+                query_params.update(pageToken="test")
+            assert kw == {"method": "GET", "path": "/foo", "query_params": query_params}
+            n_items = min(kw["query_params"]["maxResults"], NITEMS - n[0])
             items = [dict(name=str(i + n[0])) for i in range(n_items)]
             n[0] += n_items
             result = dict(items=items)
             if n[0] < NITEMS:
-                result.update(nextPageToken='test')
+                result.update(nextPageToken="test")
             return result
 
         iterator = page_iterator.HTTPIterator(
@@ -498,13 +503,12 @@
             items_iter = iter(iterator.pages)
             npages = int(math.ceil(float(n_results) / page_size))
             for ipage in range(npages):
-                assert (
-                    list(six.next(items_iter)) == [
-                        dict(name=str(i))
-                        for i in range(ipage * page_size,
-                                       min((ipage + 1) * page_size, n_results),
-                                       )
-                    ])
+                assert list(six.next(items_iter)) == [
+                    dict(name=str(i))
+                    for i in range(
+                        ipage * page_size, min((ipage + 1) * page_size, n_results),
+                    )
+                ]
         else:
             items_iter = iter(iterator)
             for i in range(n_results):
diff --git a/tests/unit/test_retry.py b/tests/unit/test_retry.py
index ce8f417..f24c82b 100644
--- a/tests/unit/test_retry.py
+++ b/tests/unit/test_retry.py
@@ -386,6 +386,7 @@
             # time clock.
             def increase_time(sleep_delay):
                 patched_utcnow.return_value += datetime.timedelta(seconds=sleep_delay)
+
             sleep.side_effect = increase_time
 
             with pytest.raises(exceptions.RetryError):
@@ -400,7 +401,7 @@
         last_wait = sleep.call_args.args[0]
         total_wait = sum(call_args.args[0] for call_args in sleep.call_args_list)
 
-        assert last_wait == 2.9   # and not 8.0, because the last delay was shortened
+        assert last_wait == 2.9  # and not 8.0, because the last delay was shortened
         assert total_wait == 9.9  # the same as the deadline
 
     @mock.patch("time.sleep", autospec=True)