Skip to content

Commit 6e91b01

Browse files
committed
further centralize cleanup
1 parent 89552bd commit 6e91b01

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jupyter_server/pytest_plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ def _configurable_serverapp(
280280
app.start_app()
281281
return app
282282

283-
yield _configurable_serverapp
284-
app: ServerApp = ServerApp.instance()
285-
loop = asyncio.get_event_loop_policy().get_event_loop()
286-
loop.run_until_complete(app._stop())
283+
return _configurable_serverapp
287284

288285

289286
@pytest.fixture
@@ -477,6 +474,9 @@ def inner(nbpath):
477474
@pytest.fixture(autouse=True)
478475
def jp_server_cleanup():
479476
yield
477+
app: ServerApp = ServerApp.instance()
478+
loop = asyncio.get_event_loop_policy().get_event_loop()
479+
loop.run_until_complete(app._stop())
480480
ServerApp.clear_instance()
481481

482482

0 commit comments

Comments
 (0)