refactor: move imports to top level per PR review feedback
Move ClientConnection import from websockets.asyncio.client to the top
level of the test file instead of inside the test function.
Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Fix PrefectCloudEventsClient failing to connect due to auth handshake
PR #20372 added an unconditional auth handshake to PrefectEventsClient._reconnect(),
but Prefect Cloud authenticates via the Authorization HTTP header, not the "prefect"
subprotocol handshake. This caused Cloud connections to fail with
"Unable to authenticate to the event stream" because the server closed the
connection upon receiving the unexpected auth message.
Extract the auth handshake into an overridable _auth_handshake() method and
override it as a no-op in PrefectCloudEventsClient. Update the test fixture
to only perform the auth handshake when the "prefect" subprotocol is negotiated.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>