Skip to content

Commit

Permalink
Fix test that creates orphaned subprocess (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cycloctane authored Jan 9, 2025
1 parent 462bce9 commit 47680ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_runserver_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async def hello(request):


@forked
def test_start_runserver_with_multi_app_modules(tmpworkdir, capfd):
async def test_start_runserver_with_multi_app_modules(tmpworkdir, capfd):
mktree(tmpworkdir, {
"app.py": f"""\
from aiohttp import web
Expand Down Expand Up @@ -149,10 +149,13 @@ async def create_app():
app_task = AppTask(config)

app_task._start_dev_server()
app_task._process.join(2)
try:
app_task._process.join(2)

captured = capfd.readouterr()
assert captured.out == ""
captured = capfd.readouterr()
assert captured.out == ""
finally:
await app_task._stop_dev_server()


@forked
Expand Down

0 comments on commit 47680ea

Please sign in to comment.