Skip to content

Commit 68513b3

Browse files
Angel Luis BlascoTinche
Angel Luis Blasco
authored andcommitted
Clarify names and comments, according to yanlend comments 26 May
1 parent 907e8f2 commit 68513b3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/async_fixtures/test_async_fixtures_with_finalizer.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66

77
@pytest.mark.asyncio
8-
async def test_module_with_event_loop_finalizer(port1):
8+
async def test_module_with_event_loop_finalizer(port_with_event_loop_finalizer):
99
await asyncio.sleep(0.01)
10-
assert port1
10+
assert port_with_event_loop_finalizer
1111

1212
@pytest.mark.asyncio
13-
async def test_module_with_get_event_loop_finalizer(port2):
13+
async def test_module_with_get_event_loop_finalizer(port_with_get_event_loop_finalizer):
1414
await asyncio.sleep(0.01)
15-
assert port2
15+
assert port_with_get_event_loop_finalizer
1616

1717
@pytest.fixture(scope="module")
1818
def event_loop():
@@ -24,11 +24,11 @@ def event_loop():
2424

2525

2626
@pytest.fixture(scope="module")
27-
async def port1(request, event_loop):
27+
async def port_with_event_loop_finalizer(request, event_loop):
2828
def port_finalizer(finalizer):
2929
async def port_afinalizer():
30-
# await task inside get_event_loop()
31-
# RantimeError is raised if task is created on a different loop
30+
# await task using loop provided by event_loop fixture
31+
# RuntimeError is raised if task is created on a different loop
3232
await finalizer
3333
event_loop.run_until_complete(port_afinalizer())
3434

@@ -38,11 +38,11 @@ async def port_afinalizer():
3838

3939

4040
@pytest.fixture(scope="module")
41-
async def port2(request, event_loop):
41+
async def port_with_get_event_loop_finalizer(request, event_loop):
4242
def port_finalizer(finalizer):
4343
async def port_afinalizer():
44-
# await task inside get_event_loop()
45-
# if loop is different a RuntimeError is raised
44+
# await task using loop provided by asyncio.get_event_loop()
45+
# RuntimeError is raised if task is created on a different loop
4646
await finalizer
4747
asyncio.get_event_loop().run_until_complete(port_afinalizer())
4848

0 commit comments

Comments
 (0)