Skip to content

Commit af2121c

Browse files
committed
Merge branch 'main' of https://github.com/googleapis/python-api-core into feat/834-bidi-async-support
2 parents 98eae06 + 14a5978 commit af2121c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/asyncio/gapic/test_method_async.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ async def test_wrap_method_with_overriding_timeout_as_a_number():
256256
result = await wrapped_method(timeout=22)
257257

258258
assert result == 42
259-
method.assert_called_once_with(timeout=22, metadata=mock.ANY)
259+
260+
actual_timeout = method.call_args[1]["timeout"]
261+
metadata = method.call_args[1]["metadata"]
262+
assert metadata == mock.ANY
263+
assert actual_timeout == pytest.approx(22, abs=0.01)
260264

261265

262266
@pytest.mark.asyncio

tests/asyncio/test_operation_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def test_constructor():
8585

8686

8787
@pytest.mark.asyncio
88-
def test_metadata():
88+
async def test_metadata():
8989
expected_metadata = struct_pb2.Struct()
9090
future, _, _ = make_operation_future(
9191
[make_operation_proto(metadata=expected_metadata)]
@@ -178,7 +178,7 @@ async def test_unexpected_result(unused_sleep):
178178

179179

180180
@pytest.mark.asyncio
181-
def test_from_gapic():
181+
async def test_from_gapic():
182182
operation_proto = make_operation_proto(done=True)
183183
operations_client = mock.create_autospec(
184184
operations_v1.OperationsClient, instance=True

0 commit comments

Comments
 (0)