def _load_jupyter_server_extension(serverapp):
    """
    This function is called when the extension is loaded.
    """
    serverapp.log.warning(f"Loading jupyterhub test extension for {serverapp}")
    handlers = [
        (
            serverapp.base_url + 'jupyterhub-test-info',
            JupyterHubTestHandler,
            {"app": serverapp},
        )
    ]
    serverapp.web_app.add_handlers('.*$', handlers)
This function is called when the extension is loaded.
jupyterhub/tests/extension/__init__.py