diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ec325e5f..2fd086db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,6 +24,8 @@ jobs: - "3.13" - "3.14" - "3.14t" + - "3.15" + - "3.15t" os: [ubuntu-latest, macos-latest] env: @@ -55,7 +57,8 @@ jobs: - name: Install macOS deps if: matrix.os == 'macos-latest' && steps.release.outputs.version == 0 run: | - brew install gnu-sed libtool autoconf automake + brew install gnu-sed libtool autoconf automake openssl@3 + echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - name: Install Python Deps if: steps.release.outputs.version == 0 diff --git a/pyproject.toml b/pyproject.toml index 1802b406..d547ccae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,9 @@ test = [ 'flake8~=6.1', 'psutil', 'pycodestyle~=2.11.0', - 'pyOpenSSL~=25.3.0', + # pyOpenSSL 26.4 requires Python 3.9 or later. + 'pyOpenSSL~=25.3.0; python_version < "3.9"', + 'pyOpenSSL~=26.4.0; python_version >= "3.9"', 'mypy>=0.800', ] dev = [ diff --git a/tests/test_sockets.py b/tests/test_sockets.py index e7c335e1..63cc8a6d 100644 --- a/tests/test_sockets.py +++ b/tests/test_sockets.py @@ -1,4 +1,5 @@ import asyncio +import os import pickle import select import socket @@ -272,7 +273,9 @@ def test_socket_sync_remove(self): # See https://github.com/MagicStack/uvloop/issues/61 for details sock = socket.socket() - epoll = select.epoll.fromfd(self.loop._get_backend_id()) + # Keep a separate descriptor for the backend epoll instance. The loop + # owns its descriptor and closes it when the loop is closed. + epoll = select.epoll.fromfd(os.dup(self.loop._get_backend_id())) try: cb = lambda: None @@ -288,8 +291,8 @@ def test_socket_sync_remove(self): finally: sock.close() - self.loop.close() epoll.close() + self.loop.close() def test_add_reader_or_writer_transport_fd(self): def assert_raises():