Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/asyncio/gapic/test_method_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ async def test_wrap_method_with_overriding_timeout_as_a_number():
result = await wrapped_method(timeout=22)

assert result == 42
method.assert_called_once_with(timeout=22, metadata=mock.ANY)

actual_timeout = method.call_args[1]["timeout"]
metadata = method.call_args[1]["metadata"]
assert metadata == mock.ANY
assert actual_timeout == pytest.approx(22, abs=0.01)


@pytest.mark.asyncio
Expand Down
4 changes: 2 additions & 2 deletions tests/asyncio/test_operation_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def test_constructor():


@pytest.mark.asyncio
def test_metadata():
async def test_metadata():
expected_metadata = struct_pb2.Struct()
future, _, _ = make_operation_future(
[make_operation_proto(metadata=expected_metadata)]
Expand Down Expand Up @@ -178,7 +178,7 @@ async def test_unexpected_result(unused_sleep):


@pytest.mark.asyncio
def test_from_gapic():
async def test_from_gapic():
operation_proto = make_operation_proto(done=True)
operations_client = mock.create_autospec(
operations_v1.OperationsClient, instance=True
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/gapic/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ def test_wrap_method_with_overriding_timeout_as_a_number():
result = wrapped_method(timeout=22)

assert result == 42
method.assert_called_once_with(timeout=22, metadata=mock.ANY)

actual_timeout = method.call_args[1]["timeout"]
metadata = method.call_args[1]["metadata"]
assert metadata == mock.ANY
assert actual_timeout == pytest.approx(22, abs=0.01)


def test_wrap_method_with_call():
Expand Down