From a46eea77e3c5afdaa9d02a2caf17a7375547164c Mon Sep 17 00:00:00 2001 From: Allan Lewis Date: Thu, 1 May 2025 15:47:53 +0100 Subject: [PATCH] Correct type of `kwargs` in `assertpy.exception.ExceptionMixin.when_called_with` (#13903) The keys of `kwargs` dicts are always strings, the type hint is for the values, which in this case could be anything. --- stubs/assertpy/assertpy/exception.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubs/assertpy/assertpy/exception.pyi b/stubs/assertpy/assertpy/exception.pyi index 2af5e46ba..b1eb47da6 100644 --- a/stubs/assertpy/assertpy/exception.pyi +++ b/stubs/assertpy/assertpy/exception.pyi @@ -5,4 +5,5 @@ __tracebackhide__: bool class ExceptionMixin: def raises(self, ex: type[BaseException] | BaseException) -> Self: ... - def when_called_with(self, *some_args: Any, **some_kwargs: dict[str, Any]) -> Self: ... + # The types of some_args and some_kwargs must equal the types of the called function. + def when_called_with(self, *some_args: Any, **some_kwargs: Any) -> Self: ...