def METHOD_NAME(before_request: Optional[AnyCallable], expected: dict) -> None:
    @get(before_request=before_request)
    def handler() -> dict:
        return {"hello": "world"}
    with create_test_client(route_handlers=handler) as client:
        response = client.get("/")
        assert response.json() == expected