From 1764b2b881cbc4abbe174b5617868f56fa3a3fcc Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 6 May 2026 14:34:49 +0100 Subject: [PATCH] Make SkipTest reason positional-only SkipTest does not override __init__ on any 3.x Python; it inherits BaseException.__init__(self, *args), where *args is positional-only at runtime. Without the / marker, the stub claims SkipTest(reason='x') is valid, but it raises TypeError at runtime. --- stdlib/unittest/case.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index a602196e73c6..7a02bdfe76b4 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -54,7 +54,7 @@ def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... class SkipTest(Exception): - def __init__(self, reason: str) -> None: ... + def __init__(self, reason: str, /) -> None: ... @type_check_only class _SupportsAbsAndDunderGE(SupportsDunderGE[Any], SupportsAbs[Any], Protocol): ...