Skip to content

Commit 22c7138

Browse files
committed
test: fix dead assert in retry streaming tests causing coverage issues
The assert statement was incorrectly indented inside the pytest.raises context manager, causing it to never execute. Dedented the assert to ensure exception messages are actually verified, which also resolves coverage gaps.
1 parent fcaad3c commit 22c7138

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/google-api-core/tests/asyncio/retry/test_retry_streaming_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async def test___call___generator_send_retry(self, sleep):
293293
generator = await retry_(self._generator_mock)(error_on=3)
294294
with pytest.raises(TypeError) as exc_info:
295295
await generator.asend("cannot send to fresh generator")
296-
assert exc_info.match("can't send non-None value")
296+
assert exc_info.match("can't send non-None value")
297297
await generator.aclose()
298298

299299
# error thrown on 3

packages/google-api-core/tests/unit/retry/test_retry_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test___call___with_generator_send_retry(self, sleep):
263263
with pytest.raises(TypeError) as exc_info:
264264
# calling first send with non-None input should raise a TypeError
265265
result.send("can not send to fresh generator")
266-
assert exc_info.match("can't send non-None value")
266+
assert exc_info.match("can't send non-None value")
267267
# initiate iteration with None
268268
result = retry_(self._generator_mock)(error_on=3)
269269
assert result.send(None) == 0

0 commit comments

Comments
 (0)