Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and use ClientConnectionResetError #9137

Merged
merged 18 commits into from
Sep 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test_client_ws.py
  • Loading branch information
Dreamsorcerer committed Sep 18, 2024
commit 7c49791b7e823569665765c55ec36d519e10b363
7 changes: 4 additions & 3 deletions tests/test_client_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import base64
import hashlib
import os
from typing import Mapping
from typing import Mapping, Type
from unittest import mock

import pytest
Expand Down Expand Up @@ -535,8 +535,9 @@ async def test_close_exc2(
await resp.close()


@pytest.mark.parametrize("exc", (ClientConnectionResetError, ConnectionResetError))
async def test_send_data_after_close(
ws_key: bytes, key_data: bytes, loop: asyncio.AbstractEventLoop
exc: Type[Exception], ws_key: bytes, key_data: bytes, loop: asyncio.AbstractEventLoop
) -> None:
mresp = mock.Mock()
mresp.status = 101
Expand All @@ -562,7 +563,7 @@ async def test_send_data_after_close(
(resp.send_bytes, (b"b",)),
(resp.send_json, ({},)),
):
with pytest.raises(ConnectionResetError):
with pytest.raises(exc): # Verify exc can be caught with both classes
await meth(*args)


Expand Down
Loading