Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Nov 17, 2023
1 parent 709eb49 commit 2026974
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions google/api_core/grpc_helpers_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def wait_for_connection(self):
except grpc.RpcError as rpc_error:
raise exceptions.from_grpc_error(rpc_error) from rpc_error

class _WrappedUnaryResponseMixin(_WrappedCall, Generic[U]):
class _WrappedUnaryResponseMixin(Generic[U], _WrappedCall):
def __await__(self) -> Generator[Any, None, U]:
try:
response = yield from self._call.__await__()
Expand All @@ -90,7 +90,7 @@ def __await__(self) -> Generator[Any, None, U]:
raise exceptions.from_grpc_error(rpc_error) from rpc_error


class _WrappedStreamResponseMixin(_WrappedCall, Generic[S]):
class _WrappedStreamResponseMixin(Generic[S], _WrappedCall):
def __init__(self):
self._wrapped_async_generator = None

Expand Down Expand Up @@ -154,7 +154,7 @@ class _WrappedStreamStreamCall(


# public type denoting the return type of streaming gapic calls
AwaitableGrpcAsyncStream = Union[_WrappedUnaryStreamCall[S], _WrappedStreamStreamCall[S]]
AwaitableGrpcStream = Union[_WrappedUnaryStreamCall[S], _WrappedStreamStreamCall[S]]
# public type denoting the return type of unary gapic calls
AwaitableGrpcCall = Union[_WrappedUnaryUnaryCall[U], _WrappedStreamUnaryCall[U]]

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_grpc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ def test_wrap_unary_errors():
assert exc_info.value.response == grpc_error


class Test_StreamingResponseIterator:
class TestGrpcStream:
@staticmethod
def _make_wrapped(*items):
return iter(items)

@staticmethod
def _make_one(wrapped, **kw):
return grpc_helpers._StreamingResponseIterator(wrapped, **kw)
return grpc_helpers.GrpcStream(wrapped, **kw)

def test_ctor_defaults(self):
wrapped = self._make_wrapped("a", "b", "c")
Expand Down

0 comments on commit 2026974

Please sign in to comment.