def disable_refresh(app):
    """Fixture disabling auth refresh"""
    with mock.patch.object(app.authenticator, 'refresh_user', refresh_expired):
        yield
Fixture disabling auth refresh
jupyterhub/tests/test_auth_expiry.py