Skip to content

Commit 5ea9750

Browse files
committed
Enable verbose logging in CI
1 parent e487de8 commit 5ea9750

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: poetry install
5151
shell: bash
5252
- name: Test with Pytest
53-
run: poetry run pytest
53+
run: poetry run pytest --log-level=DEBUG -vv -s
5454
shell: bash
5555
release:
5656
runs-on: ubuntu-latest

tests/devices/test_mqtt_channel.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import json
5+
import logging
56
from collections.abc import Callable, Generator
67
from unittest.mock import AsyncMock, Mock, patch
78

@@ -82,6 +83,15 @@ async def setup_message_handler(mqtt_session: Mock, mqtt_channel: MqttChannel) -
8283
return message_handler
8384

8485

86+
@pytest.fixture
87+
def warning_caplog(
88+
caplog: pytest.LogCaptureFixture,
89+
) -> Generator[pytest.LogCaptureFixture]:
90+
"""Fixture to capture warning messages."""
91+
caplog.set_level(logging.WARNING)
92+
yield caplog
93+
94+
8595
async def home_home_data_no_devices() -> HomeData:
8696
"""Mock home data API that returns no devices."""
8797
return HomeData(
@@ -163,7 +173,7 @@ async def test_concurrent_commands(
163173
mqtt_session: Mock,
164174
mqtt_channel: MqttChannel,
165175
mqtt_message_handler: Callable[[bytes], None],
166-
caplog: pytest.LogCaptureFixture,
176+
warning_caplog: pytest.LogCaptureFixture,
167177
) -> None:
168178
"""Test handling multiple concurrent RPC commands."""
169179

@@ -187,7 +197,7 @@ async def test_concurrent_commands(
187197
assert result1 == TEST_RESPONSE
188198
assert result2 == TEST_RESPONSE2
189199

190-
assert not caplog.records
200+
assert not warning_caplog.records
191201

192202

193203
async def test_concurrent_commands_same_request_id(

0 commit comments

Comments
 (0)