@@ -292,7 +292,7 @@ async def test_post_xml_without_retry_decorator_fails() -> None:
292
292
"""Test that without the retry decorator on post_xml, ServerDisconnectedError propagates."""
293
293
294
294
# Create a mock session
295
- mock_session : Mock = Mock (spec = ClientSession )
295
+ mock_session = Mock (spec = ClientSession )
296
296
mock_session .timeout = Mock (total = 30 , sock_read = 10 )
297
297
298
298
# Create the base transport (without retry decorator)
@@ -318,7 +318,7 @@ async def test_post_xml_without_retry_decorator_fails() -> None:
318
318
319
319
320
320
@pytest .mark .asyncio
321
- async def test_post_xml_with_retry_decorator_succeeds ():
321
+ async def test_post_xml_with_retry_decorator_succeeds () -> None :
322
322
"""Test that with the retry decorator on post_xml, ServerDisconnectedError is retried."""
323
323
324
324
# Create a mock session
@@ -360,7 +360,7 @@ async def test_post_xml_with_retry_decorator_succeeds():
360
360
361
361
362
362
@pytest .mark .asyncio
363
- async def test_post_xml_decorator_is_applied ():
363
+ async def test_post_xml_decorator_is_applied () -> None :
364
364
"""Verify that the post_xml method has the retry decorator applied."""
365
365
366
366
# Check that AsyncTransportProtocolErrorHandler.post_xml has the decorator
@@ -401,7 +401,7 @@ async def test_post_xml_decorator_is_applied():
401
401
402
402
403
403
@pytest .mark .asyncio
404
- async def test_retry_only_for_server_disconnected ():
404
+ async def test_retry_only_for_server_disconnected () -> None :
405
405
"""Test that retry only happens for ServerDisconnectedError, not other exceptions."""
406
406
407
407
mock_session = Mock (spec = ClientSession )
@@ -420,9 +420,8 @@ async def test_retry_only_for_server_disconnected():
420
420
side_effect = aiohttp .ClientError ("Different error" )
421
421
)
422
422
423
- with pytest .raises (aiohttp .ClientError ) as exc_info :
423
+ with pytest .raises (aiohttp .ClientError , match = "Different error" ) :
424
424
await transport .post_xml ("http://example.com/onvif" , mock_envelope , {})
425
425
426
- assert str (exc_info .value ) == "Different error"
427
426
# Should only be called once (no retry for other errors)
428
427
assert mock_session .post .call_count == 1
0 commit comments