From 791e5e5f885d4ce9bdc06a5083e07183312c256d Mon Sep 17 00:00:00 2001 From: Jane R Date: Fri, 18 Sep 2026 13:51:42 -0400 Subject: [PATCH 1/5] use inspect.getdoc --- src/trio/_tests/_check_type_completeness.json | 35 ------------------- src/trio/_tests/check_type_completeness.py | 5 +-- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/trio/_tests/_check_type_completeness.json b/src/trio/_tests/_check_type_completeness.json index e5414cfe56..1a294b3ea2 100644 --- a/src/trio/_tests/_check_type_completeness.json +++ b/src/trio/_tests/_check_type_completeness.json @@ -1,44 +1,9 @@ { "Darwin": [ - "No docstring found for function \"trio._unix_pipes.FdStream.send_all\"", - "No docstring found for function \"trio._unix_pipes.FdStream.wait_send_all_might_not_block\"", - "No docstring found for function \"trio._unix_pipes.FdStream.receive_some\"", - "No docstring found for function \"trio._unix_pipes.FdStream.close\"", - "No docstring found for function \"trio._unix_pipes.FdStream.aclose\"", - "No docstring found for function \"trio._unix_pipes.FdStream.fileno\"" ], "Linux": [ - "No docstring found for class \"trio._core._io_epoll._EpollStatistics\"", - "No docstring found for function \"trio._unix_pipes.FdStream.send_all\"", - "No docstring found for function \"trio._unix_pipes.FdStream.wait_send_all_might_not_block\"", - "No docstring found for function \"trio._unix_pipes.FdStream.receive_some\"", - "No docstring found for function \"trio._unix_pipes.FdStream.close\"", - "No docstring found for function \"trio._unix_pipes.FdStream.aclose\"", - "No docstring found for function \"trio._unix_pipes.FdStream.fileno\"" ], "Windows": [], "all": [ - "No docstring found for class \"trio._core._run.Task\"", - "No docstring found for class \"trio._socket.SocketType\"", - "No docstring found for function \"trio._highlevel_socket.SocketStream.send_all\"", - "No docstring found for function \"trio._highlevel_socket.SocketStream.wait_send_all_might_not_block\"", - "No docstring found for function \"trio._highlevel_socket.SocketStream.send_eof\"", - "No docstring found for function \"trio._highlevel_socket.SocketStream.receive_some\"", - "No docstring found for function \"trio._highlevel_socket.SocketStream.aclose\"", - "No docstring found for function \"trio._subprocess.HasFileno.fileno\"", - "No docstring found for class \"trio._sync.AsyncContextManagerMixin\"", - "No docstring found for function \"trio._sync._HasAcquireRelease.acquire\"", - "No docstring found for function \"trio._sync._HasAcquireRelease.release\"", - "No docstring found for class \"trio._sync._LockImpl\"", - "No docstring found for class \"trio._core._local._NoValue\"", - "No docstring found for class \"trio._core._local.RunVarToken\"", - "No docstring found for class \"trio.lowlevel.RunVarToken\"", - "No docstring found for class \"trio.lowlevel.Task\"", - "No docstring found for class \"trio.socket.SocketType\"", - "No docstring found for class \"trio.socket.gaierror\"", - "No docstring found for class \"trio.socket.herror\"", - "No docstring found for function \"trio._core._mock_clock.MockClock.start_clock\"", - "No docstring found for function \"trio._core._mock_clock.MockClock.current_time\"", - "No docstring found for function \"trio._core._mock_clock.MockClock.deadline_to_sleep_time\"" ] } diff --git a/src/trio/_tests/check_type_completeness.py b/src/trio/_tests/check_type_completeness.py index a0f23a66e9..8658c1020d 100755 --- a/src/trio/_tests/check_type_completeness.py +++ b/src/trio/_tests/check_type_completeness.py @@ -16,7 +16,7 @@ import subprocess import sys from pathlib import Path - +import inspect import trio import trio.testing @@ -108,7 +108,8 @@ def has_docstring_at_runtime(name: str) -> bool: file=sys.stderr, ) return False - return bool(obj.__doc__) + doc = inspect.getdoc(obj) + return bool(doc) def check_type( From 7ff6fbc25cb1e20a486843b536ab61140f1c5b61 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 18 Sep 2026 13:56:14 -0400 Subject: [PATCH 2/5] add changelog --- newsfragments/3226.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/3226.bugfix.rst diff --git a/newsfragments/3226.bugfix.rst b/newsfragments/3226.bugfix.rst new file mode 100644 index 0000000000..bcbf6912da --- /dev/null +++ b/newsfragments/3226.bugfix.rst @@ -0,0 +1 @@ +Fix issue in tox:type_completeness check that relates to checking docstrings when they are defined in base class. \ No newline at end of file From a9cbd2003ce6a2e615374af00a8e1581d6d248cf Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 18 Sep 2026 14:00:53 -0400 Subject: [PATCH 3/5] remove only fixed from completeness.json --- src/trio/_tests/_check_type_completeness.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/trio/_tests/_check_type_completeness.json b/src/trio/_tests/_check_type_completeness.json index 1a294b3ea2..d8a2948cd9 100644 --- a/src/trio/_tests/_check_type_completeness.json +++ b/src/trio/_tests/_check_type_completeness.json @@ -1,9 +1,24 @@ { "Darwin": [ + "No docstring found for function \"trio._unix_pipes.FdStream.close\"", + "No docstring found for function \"trio._unix_pipes.FdStream.fileno\"" ], "Linux": [ + "No docstring found for class \"trio._core._io_epoll._EpollStatistics\"", + "No docstring found for function \"trio._unix_pipes.FdStream.close\"", + "No docstring found for function \"trio._unix_pipes.FdStream.fileno\"" ], "Windows": [], "all": [ + "No docstring found for class \"trio._core._run.Task\"", + "No docstring found for class \"trio._socket.SocketType\"", + "No docstring found for function \"trio._subprocess.HasFileno.fileno\"", + "No docstring found for class \"trio._sync.AsyncContextManagerMixin\"", + "No docstring found for function \"trio._sync._HasAcquireRelease.acquire\"", + "No docstring found for function \"trio._sync._HasAcquireRelease.release\"", + "No docstring found for class \"trio._sync._LockImpl\"", + "No docstring found for class \"trio._core._local._NoValue\"", + "No docstring found for class \"trio.lowlevel.Task\"", + "No docstring found for class \"trio.socket.SocketType\"" ] } From 647e43103032bddbe6c87db32cfed89fc733ccde Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 18:04:15 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- newsfragments/3226.bugfix.rst | 2 +- src/trio/_tests/check_type_completeness.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/newsfragments/3226.bugfix.rst b/newsfragments/3226.bugfix.rst index bcbf6912da..504fa2b7a2 100644 --- a/newsfragments/3226.bugfix.rst +++ b/newsfragments/3226.bugfix.rst @@ -1 +1 @@ -Fix issue in tox:type_completeness check that relates to checking docstrings when they are defined in base class. \ No newline at end of file +Fix issue in tox:type_completeness check that relates to checking docstrings when they are defined in base class. diff --git a/src/trio/_tests/check_type_completeness.py b/src/trio/_tests/check_type_completeness.py index 8658c1020d..bbf38080d3 100755 --- a/src/trio/_tests/check_type_completeness.py +++ b/src/trio/_tests/check_type_completeness.py @@ -12,11 +12,12 @@ # this file is not run as part of the tests, instead it's run standalone from check.sh import argparse +import inspect import json import subprocess import sys from pathlib import Path -import inspect + import trio import trio.testing From 2a43a1f1601a889edbad8b515021b5c416ac197f Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 21 Sep 2026 08:55:35 -0400 Subject: [PATCH 5/5] remove newsfragment --- newsfragments/3226.bugfix.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 newsfragments/3226.bugfix.rst diff --git a/newsfragments/3226.bugfix.rst b/newsfragments/3226.bugfix.rst deleted file mode 100644 index 504fa2b7a2..0000000000 --- a/newsfragments/3226.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix issue in tox:type_completeness check that relates to checking docstrings when they are defined in base class.