def refresh_pre_spawn(app):
    """Fixture enabling auth refresh pre spawn"""
    app.authenticator.refresh_pre_spawn = True
    try:
        yield
    finally:
        app.authenticator.refresh_pre_spawn = False
Fixture enabling auth refresh pre spawn
jupyterhub/tests/test_auth_expiry.py