Skip to content

Commit 4e8d95a

Browse files
committed
Add a test case for the default logging configuration
1 parent fe7fb9b commit 4e8d95a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/unit/runners/test_uvicorn_runner.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,16 @@ def test_start_uvicorn_respects_debug_log_level(
189189
access_log=True,
190190
log_config={},
191191
)
192+
193+
194+
def test_start_uvicorn_no_log_config(mocker: MockerFixture) -> None:
195+
"""Test that the default logging config is used when none is provided."""
196+
configuration = ServiceConfiguration(
197+
host="localhost", port=8080, workers=1
198+
) # pyright: ignore[reportCallIssue]
199+
200+
mock_setup_logging = mocker.patch("runners.uvicorn.setup_logging")
201+
mock_setup_logging.side_effect = ValueError("Raised intentionally")
202+
203+
with pytest.raises(ValueError, match="Raised intentionally"):
204+
start_uvicorn(configuration)

0 commit comments

Comments
 (0)