Skip to content

Commit 1764b2b

Browse files
committed
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.
1 parent 85f39ef commit 1764b2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

stdlib/unittest/case.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ...
5454
def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ...
5555

5656
class SkipTest(Exception):
57-
def __init__(self, reason: str) -> None: ...
57+
def __init__(self, reason: str, /) -> None: ...
5858

5959
@type_check_only
6060
class _SupportsAbsAndDunderGE(SupportsDunderGE[Any], SupportsAbs[Any], Protocol): ...

0 commit comments

Comments
 (0)