def METHOD_NAME(sentry_init, capture_events):
    sentry_init()
    s = Scope()
    s.set_user({"id": "42"})
    events = capture_events()
    capture_exception(NameError(), scope=s)
    (event,) = events
    assert event["user"] == {"id": "42"}