Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/quart_injector/scope.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""
Request :class:`~injector.Scope`.
"""

import typing
Copy link
Member

@danielknell danielknell Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import typing
"""
Request :class:`~injector.Scope`.
"""
import typing

why remove the comment and spacing? this will upset the linters.


import injector
import quart
import werkzeug.local
Expand Down Expand Up @@ -69,8 +64,8 @@ async def before_func() -> None:
async def teardown_func(_: BaseException | None) -> None:
container.get(scope_cls).pop()

app.before_request_funcs[None].insert(0, before_func)
app.before_websocket_funcs[None].insert(0, before_func)
app.before_request_funcs[None] = [(before_func, None)] + app.before_request_funcs[None]
app.before_websocket_funcs[None] = [(before_func, None)] + app.before_websocket_funcs[None]

app.teardown_request_funcs[None].insert(0, teardown_func)
app.teardown_websocket_funcs[None].insert(0, teardown_func)
app.teardown_request_funcs[None] = [(teardown_func, None)] + app.teardown_request_funcs[None]
app.teardown_websocket_funcs[None] = [(teardown_func, None)] + app.teardown_websocket_funcs[None]