From d55c971644c3d187e712cb514a1dc028e13932c0 Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 25 Jun 2026 19:09:42 -0400 Subject: [PATCH] Filter 2 unfixable-at-source test warnings via ini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two test-suite warnings can't be fixed at source, so register documented `[tool.pytest.ini_options] filterwarnings` ignores (real library users still see both): - `forkpty()` multi-threaded `DeprecationWarning` — emitted by `pexpect` (stdlib `pty.py`) for the `devx` debugger REPL tests; we never call it. UPSTREAM fix = pexpect avoiding `forkpty()` under multithreading. - `@tractor.stream` `DeprecationWarning` — the legacy `test_legacy_one_way_streaming.py` exists to test that DEPRECATED API; the warning fires at import (module-level decorators) so a per-test mark can't catch it, hence the ini filter. (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- pyproject.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 47430ed6..4106ff04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -279,4 +279,25 @@ log_cli = false # https://docs.pytest.org/en/stable/reference/reference.html#confval-console_output_style console_output_style = 'progress' + +# `pexpect` (used only by the `devx` debugger REPL tests) allocates +# its child pty via stdlib `pty.py:os.forkpty()`, which CPython +# 3.12+ flags as unsafe in a multi-threaded process. This is NOT +# ours to fix at source — we never call `forkpty()`; pexpect does. +# UPSTREAM to actually resolve: pexpect would need to avoid +# `forkpty()` under multithreading (or perform the pty spawn before +# any thread starts); until then this single third-party warning is +# the one we filter rather than fix. +filterwarnings = [ + 'ignore:This process \(pid=\d+\) is multi-threaded, use of forkpty\(\):DeprecationWarning', + + # `tests/test_legacy_one_way_streaming.py` exists *specifically* + # to exercise the DEPRECATED `@tractor.stream` async-gen API, so + # its decoration-time `DeprecationWarning` is expected — and since + # it fires at import (module-level decorators) it can't be caught + # by a per-test mark, hence this test-wide ini filter. Real + # library users still see the warning; drop this once the legacy + # `@tractor.stream` / `Portal.open_stream_from()` API is removed. + 'ignore:`@tractor.stream decorated funcs:DeprecationWarning', +] # ------ tool.pytest ------