Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Oct 9, 2024
1 parent 692406f commit 5f6dfab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ def test_app_unimportable_module() -> None:


def test_app_unimportable_other(caplog: pytest.LogCaptureFixture) -> None:
config = Config(app="tests.test_config:unimportable_app")
config = Config(app="tests.test_config:app")
with pytest.raises(SystemExit):
config.load()
error_messages = [
record.message for record in caplog.records if record.name == "uvicorn.error" and record.levelname == "ERROR"
]
assert (
'Error loading ASGI app. Attribute "unimportable_app" not found in module "tests.test_config".' # noqa: E501
'Error loading ASGI app. Attribute "app" not found in module "tests.test_config".' # noqa: E501
== error_messages.pop(0)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ async def test_request_than_limit_max_requests_warn_log(
tasks = [client.get(f"http://127.0.0.1:{unused_tcp_port}") for _ in range(2)]
responses = await asyncio.gather(*tasks)
assert len(responses) == 2
assert f"Maximum request limit of {config.limit_max_requests} exceeded. Terminating process." in caplog.text
assert "Maximum request limit of 1 exceeded. Terminating process." in caplog.text

0 comments on commit 5f6dfab

Please sign in to comment.