diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d8a95a70d..3aa579aa4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: - name: Install Python 3.x uses: actions/setup-python@v2 with: - python-version: "3.9.6" + python-version: "3.x" - name: Install tox run: pip install tox - name: Run tests with coverage @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.7", "3.8", "3.9.6", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Check out repository uses: actions/checkout@v2 diff --git a/src/websockets/legacy/protocol.py b/src/websockets/legacy/protocol.py index a52f9f71d..3340c33be 100644 --- a/src/websockets/legacy/protocol.py +++ b/src/websockets/legacy/protocol.py @@ -750,7 +750,7 @@ async def close(self, code: int = 1000, reason: str = "") -> None: self.write_close_frame(Close(code, reason)), self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except asyncio.TimeoutError: # If the close frame cannot be sent because the send buffers # are full, the closing handshake won't complete anyway. @@ -771,7 +771,7 @@ async def close(self, code: int = 1000, reason: str = "") -> None: self.transfer_data_task, self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except (asyncio.TimeoutError, asyncio.CancelledError): pass @@ -1250,7 +1250,7 @@ async def keepalive_ping(self) -> None: pong_waiter, self.ping_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 self.logger.debug("% received keepalive pong") except asyncio.TimeoutError: if self.debug: @@ -1365,7 +1365,7 @@ async def wait_for_connection_lost(self) -> bool: asyncio.shield(self.connection_lost_waiter), self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except asyncio.TimeoutError: pass # Re-check self.connection_lost_waiter.done() synchronously because diff --git a/tests/legacy/test_client_server.py b/tests/legacy/test_client_server.py index fea2b4178..4eb8229b2 100644 --- a/tests/legacy/test_client_server.py +++ b/tests/legacy/test_client_server.py @@ -1454,6 +1454,7 @@ async def run_client(): await server_ws.close() with self.assertRaises(ConnectionClosed): await ws.recv() + pass # work around bug in coverage else: # Exit block with an exception. raise Exception("BOOM!")