Skip to content

Commit e2b0e29

Browse files
committed
Reformat
1 parent 68a82cc commit e2b0e29

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

pytest_asyncio/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ def pytest_fixture_post_finalizer(fixturedef, request):
174174
"""Called after fixture teardown"""
175175
if fixturedef.argname == "event_loop":
176176
policy = asyncio.get_event_loop_policy()
177-
policy.get_event_loop().close() # Clean up existing loop to avoid ResourceWarnings
177+
# Clean up existing loop to avoid ResourceWarnings
178+
policy.get_event_loop().close()
178179
new_loop = policy.new_event_loop() # Replace existing event loop
179180
# Ensure subsequent calls to get_event_loop() succeed
180181
policy.set_event_loop(new_loop)
@@ -297,7 +298,8 @@ def pytest_pyfunc_call(pyfuncitem):
297298
"""
298299
Pytest hook called before a test case is run.
299300
300-
Wraps marked tests in a synchronous function where the wrapped test coroutine is executed in an event loop.
301+
Wraps marked tests in a synchronous function
302+
where the wrapped test coroutine is executed in an event loop.
301303
"""
302304
if "asyncio" in pyfuncitem.keywords:
303305
if getattr(pyfuncitem.obj, "is_hypothesis_test", False):

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ filterwarnings = error
1515
license_file = LICENSE
1616

1717
[flake8]
18-
ignore = E203, E501, W503
18+
max-line-length = 88

tests/async_fixtures/test_async_fixtures_with_finalizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def port_finalizer(finalizer):
4646
async def port_afinalizer():
4747
# await task using current loop retrieved from the event loop policy
4848
# RuntimeError is raised if task is created on a different loop.
49-
# This can happen when pytest_fixture_setup does not set up the loop correctly,
49+
# This can happen when pytest_fixture_setup
50+
# does not set up the loop correctly,
5051
# for example when policy.set_event_loop() is called with a wrong argument
5152
await finalizer
5253

tests/hypothesis/test_inherited_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ async def test_hypothesis(self, value: int) -> None:
1111

1212

1313
class TestOne(BaseClass):
14-
"""During the first execution the Hypothesis test is wrapped in a synchronous function."""
14+
"""During the first execution the Hypothesis test
15+
is wrapped in a synchronous function."""
1516

1617

1718
class TestTwo(BaseClass):
18-
"""Execute the test a second time to ensure that the test receives a fresh event loop."""
19+
"""Execute the test a second time to ensure that
20+
the test receives a fresh event loop."""

tests/respect_event_loop_policy/test_respects_event_loop_policy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
@pytest.mark.asyncio
88
async def test_uses_loop_provided_by_custom_policy():
9-
"""Asserts that test cases use the event loop provided by the custom event loop policy"""
9+
"""Asserts that test cases use the event loop
10+
provided by the custom event loop policy"""
1011
assert type(asyncio.get_event_loop()).__name__ == "TestEventLoop"
1112

1213

tests/test_simple.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,15 @@ class TestMarkerInClassBasedTests:
197197

198198
@pytest.mark.asyncio
199199
async def test_asyncio_marker_with_explicit_loop_fixture(self, event_loop):
200-
"""Test the "asyncio" marker works on a method in a class-based test with explicit loop fixture."""
200+
"""Test the "asyncio" marker works on a method in
201+
a class-based test with explicit loop fixture."""
201202
ret = await async_coro()
202203
assert ret == "ok"
203204

204205
@pytest.mark.asyncio
205206
async def test_asyncio_marker_with_implicit_loop_fixture(self):
206-
"""Test the "asyncio" marker works on a method in a class-based test with implicit loop fixture."""
207+
"""Test the "asyncio" marker works on a method in
208+
a class-based test with implicit loop fixture."""
207209
ret = await async_coro()
208210
assert ret == "ok"
209211

0 commit comments

Comments
 (0)