Skip to content

Commit 5ffdfcc

Browse files
committed
Make the test suite work with 3.15
1 parent a97133a commit 5ffdfcc

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
strategy:
169169
fail-fast: false
170170
matrix:
171-
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
171+
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
172172
arch: ['x86', 'x64']
173173
lsp: ['']
174174
lsp_extract_file: ['']
@@ -242,7 +242,7 @@ jobs:
242242
strategy:
243243
fail-fast: false
244244
matrix:
245-
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
245+
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
246246
check_formatting: ['0']
247247
no_test_requirements: ['0']
248248
extra_name: ['']
@@ -320,7 +320,7 @@ jobs:
320320
strategy:
321321
fail-fast: false
322322
matrix:
323-
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
323+
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
324324
continue-on-error: >-
325325
${{
326326
(

src/trio/_core/_tests/test_thread_cache.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from __future__ import annotations
22

33
import os
4+
import sys
45
import threading
56
import time
7+
import warnings
68
from contextlib import contextmanager
79
from queue import Queue
810
from typing import TYPE_CHECKING, NoReturn
@@ -210,7 +212,17 @@ def foo() -> None:
210212
start_thread_soon(foo, lambda _: done.set())
211213
done.wait()
212214

213-
child_pid = os.fork()
215+
with warnings.catch_warnings(record=True) as emitted:
216+
# TODO: remove this extra filter once we drop 3.14. See
217+
# https://github.com/python-trio/trio/issues/3355.
218+
warnings.simplefilter("default")
219+
child_pid = os.fork()
220+
221+
if child_pid != 0 and sys.version_info < (3, 12):
222+
# the warning is only emitted in the parent
223+
assert len(emitted) == 1
224+
assert isinstance(emitted[0].message, DeprecationWarning)
225+
assert "fork() may lead to" in str(emitted[0].message)
214226

215227
# try using it
216228
done = threading.Event()

0 commit comments

Comments
 (0)