From b86aa679498a90c976f11428e1b4f90d2cc09872 Mon Sep 17 00:00:00 2001 From: Nigel Jones Date: Fri, 25 Sep 2026 12:59:31 +0100 Subject: [PATCH] fix: anchor coverage ellipsis exclude pattern to stub bodies (#1681) The bare "\.\.\." exclude_lines regex matched any source line containing three dots, including lines like `generate_func: Callable[..., _T]`. When such a line opens a block, coverage.py excludes the whole block, so the function silently disappeared from the coverage report instead of showing as covered or missing. Anchor the pattern to a bare-ellipsis stub body (`^\s*\.\.\.$`) so it only matches genuine `...` stub statements, not `...` appearing inside a type annotation or elsewhere on the line. Assisted-by: pi coding agent Signed-off-by: Nigel Jones --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bce2aacce..cb9934546 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -436,7 +436,7 @@ exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", "@abstractmethod", - "\\.\\.\\.", # Ellipsis in function bodies + "^\\s*\\.\\.\\.$", # Ellipsis stub bodies (not `...` inside e.g. Callable[..., T]) ] [tool.coverage.html]