Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 5, 2025
1 parent 9b79717 commit f591f07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pytest_asyncio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,10 @@ def scoped_event_loop(
event_loop_policy,
) -> Iterator[asyncio.AbstractEventLoop]:
new_loop_policy = event_loop_policy
with _temporary_event_loop_policy(new_loop_policy), _provide_event_loop() as loop:
with (
_temporary_event_loop_policy(new_loop_policy),
_provide_event_loop() as loop,
):
asyncio.set_event_loop(loop)
yield loop

Expand Down Expand Up @@ -1149,7 +1152,6 @@ def event_loop(request: FixtureRequest) -> Iterator[asyncio.AbstractEventLoop]:
yield loop



@contextlib.contextmanager
def _provide_event_loop() -> Iterator[asyncio.AbstractEventLoop]:
loop = asyncio.get_event_loop_policy().new_event_loop()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_event_loop_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def test_something():
async def generator_fn():
yield
yield
gen = generator_fn()
await gen.__anext__()
"""
Expand Down

0 comments on commit f591f07

Please sign in to comment.