From 0e44693819d38fdcf70562d42f0e3c2851a001c7 Mon Sep 17 00:00:00 2001 From: Tim Kreuzer Date: Fri, 4 Jul 2025 06:17:43 +0000 Subject: [PATCH] add review comment changes --- jupyterhub/auth.py | 6 ++++-- jupyterhub/tests/test_auth_expiry.py | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jupyterhub/auth.py b/jupyterhub/auth.py index a918a311..11e23bf0 100644 --- a/jupyterhub/auth.py +++ b/jupyterhub/auth.py @@ -114,11 +114,13 @@ class Authenticator(LoggingConfigurable): This forces :meth:`.refresh_user` to be called prior to stopping a server, to ensure that auth state is up-to-date. - This can be important when e.g. auth tokens that may have expired - are passed to the spawner via environment variables from auth_state. + This can be important when e.g. auth tokens stored in auth_state may have expired, + but are a required part of the Spawner's shutdown steps. If refresh_user cannot refresh the user auth data, stop will fail until the user logs in again. + + .. versionadded:: 5.4 """, ) diff --git a/jupyterhub/tests/test_auth_expiry.py b/jupyterhub/tests/test_auth_expiry.py index 3db11f4b..6a6b8593 100644 --- a/jupyterhub/tests/test_auth_expiry.py +++ b/jupyterhub/tests/test_auth_expiry.py @@ -41,10 +41,8 @@ def refresh_pre_spawn(app): def refresh_pre_stop(app): """Fixture enabling auth refresh pre stop""" app.authenticator.refresh_pre_stop = True - try: - yield - finally: - app.authenticator.refresh_pre_stop = False + yield + app.authenticator.refresh_pre_stop = False async def test_auth_refresh_at_login(app, user):