chore: remove caplog from test cases

This commit is contained in:
Björn Otgaar
2025-11-17 16:04:54 +01:00
parent debc87c0bb
commit 41993a902b
2 changed files with 11 additions and 13 deletions

View File

@@ -73,7 +73,7 @@ async def test_send_commands_behaviour_valid_message():
@pytest.mark.asyncio
async def test_send_commands_behaviour_invalid_message(caplog):
async def test_send_commands_behaviour_invalid_message():
"""Test behaviour with invalid JSON message triggers error logging"""
fake_socket = AsyncMock()
fake_socket.recv_multipart = AsyncMock(return_value=(b"command", b"{invalid_json}"))
@@ -86,9 +86,7 @@ async def test_send_commands_behaviour_invalid_message(caplog):
behaviour = agent.SendCommandsBehaviour()
behaviour.agent = agent
with caplog.at_level("ERROR"):
await behaviour.run()
await behaviour.run()
fake_socket.recv_multipart.assert_awaited()
fake_socket.send_json.assert_not_awaited()
assert "Error processing message" in caplog.text