Skip to content

Commit

Permalink
🚨 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Feb 4, 2025
1 parent 10066ae commit f1502bd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions nonebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ def get_asgi() -> Any:
```
"""
driver = get_driver()
assert isinstance(
driver, ASGIMixin
), "asgi object is only available for asgi driver"
assert isinstance(driver, ASGIMixin), (
"asgi object is only available for asgi driver"
)
return driver.asgi


Expand Down
6 changes: 2 additions & 4 deletions nonebot/drivers/none.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
"</bg #f8bbd0></r>"
)
logger.error(
"<r><bg #f8bbd0>Application startup failed. "
"Exiting.</bg #f8bbd0></r>"
"<r><bg #f8bbd0>Application startup failed. Exiting.</bg #f8bbd0></r>"
)

with catch({Exception: handle_exception}):
Expand Down Expand Up @@ -136,8 +135,7 @@ def handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None:
"</bg #f8bbd0></r>"
)
logger.error(
"<r><bg #f8bbd0>Application shutdown failed. "
"Exiting.</bg #f8bbd0></r>"
"<r><bg #f8bbd0>Application shutdown failed. Exiting.</bg #f8bbd0></r>"
)

with catch({Exception: handle_exception}):
Expand Down
12 changes: 6 additions & 6 deletions nonebot/internal/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ def _check_param(
dependency: T_Handler
# sub dependency is not specified, use type annotation
if depends_inner.dependency is None:
assert (
type_annotation is not inspect.Signature.empty
), "Dependency cannot be empty"
assert type_annotation is not inspect.Signature.empty, (
"Dependency cannot be empty"
)
dependency = type_annotation
else:
dependency = depends_inner.dependency
Expand Down Expand Up @@ -291,9 +291,9 @@ def _handle_skipped(exc_group: BaseExceptionGroup[SkippedException]):
return await dependency_cache[call].wait()

if is_gen_callable(call) or is_async_gen_callable(call):
assert isinstance(
stack, AsyncExitStack
), "Generator dependency should be called in context"
assert isinstance(stack, AsyncExitStack), (
"Generator dependency should be called in context"
)
if is_gen_callable(call):
cm = run_sync_ctx_manager(contextmanager(call)(**sub_values))
else:
Expand Down
3 changes: 1 addition & 2 deletions packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def init():
if host in {"0.0.0.0", "127.0.0.1"}:
host = "localhost"
logger.opt(colors=True).info(
f"Nonebot docs will be running at: "
f"<b><u>http://{host}:{port}/website/</u></b>"
f"Nonebot docs will be running at: <b><u>http://{host}:{port}/website/</u></b>"
)


Expand Down
6 changes: 3 additions & 3 deletions tests/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ async def test_http_client(driver: Driver, server_url: URL):
cookies={"session": "test"},
content="test",
)
assert (
request.url == request_raw_url.url
), "request.url should be equal to request_raw_url.url"
assert request.url == request_raw_url.url, (
"request.url should be equal to request_raw_url.url"
)
assert response.status_code == 200
assert response.content
data = json.loads(response.content)
Expand Down

0 comments on commit f1502bd

Please sign in to comment.