From 5342d66dcceda0137a0e9f700407464a436004ea Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Tue, 5 May 2020 19:20:56 +0100 Subject: [PATCH] Fix assert_has_calls() signature (#3967) See the docs https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_has_calls --- stdlib/3/unittest/mock.pyi | 4 ++-- third_party/2and3/mock.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index 791f94a7a..9df57a9ec 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -1,7 +1,7 @@ # Stubs for mock import sys -from typing import Any, List, Optional, Text, Tuple, Type, TypeVar +from typing import Any, List, Optional, Sequence, Text, Tuple, Type, TypeVar _T = TypeVar("_T") @@ -101,7 +101,7 @@ class NonCallableMock(Base, Any): # type: ignore def _get_call_signature_from_name(self, name: str) -> Any: ... def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... def _mock_add_spec(self, spec: Any, spec_set, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... diff --git a/third_party/2and3/mock.pyi b/third_party/2and3/mock.pyi index 791f94a7a..9df57a9ec 100644 --- a/third_party/2and3/mock.pyi +++ b/third_party/2and3/mock.pyi @@ -1,7 +1,7 @@ # Stubs for mock import sys -from typing import Any, List, Optional, Text, Tuple, Type, TypeVar +from typing import Any, List, Optional, Sequence, Text, Tuple, Type, TypeVar _T = TypeVar("_T") @@ -101,7 +101,7 @@ class NonCallableMock(Base, Any): # type: ignore def _get_call_signature_from_name(self, name: str) -> Any: ... def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... def _mock_add_spec(self, spec: Any, spec_set, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ...