From d2fb835958373e8083bdc1805c732fb518e5af7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Mon, 6 Mar 2017 07:20:56 +0000 Subject: [PATCH 1/5] Fix unittest/mock.pyi Add a lot of missing types --- stdlib/3/unittest/mock.pyi | 136 +++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index 3d54fe938cd7..a78d00283fee 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -10,35 +10,34 @@ if sys.version_info >= (3, 3): class _SentinelObject: name = ... # type: Any - def __init__(self, name): ... + def __init__(self, name: Any) -> None: ... class _Sentinel: - def __init__(self): ... - def __getattr__(self, name): ... + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... sentinel = ... # type: Any DEFAULT = ... # type: Any class _CallList(list): - def __contains__(self, value): ... + def __contains__(self, value: Any) -> bool: ... class _MockIter: obj = ... # type: Any - def __init__(self, obj): ... - def __iter__(self): ... - def __next__(self): ... + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... class Base: - def __init__(self, *args, **kwargs): ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... - class NonCallableMock(Base): - def __new__(cls, *args, **kw): ... - def __init__(self, spec=None, wraps=None, name=None, spec_set=None, parent=None, _spec_state=None, _new_name='', _new_parent=None, _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs): ... - def attach_mock(self, mock, attribute): ... - def mock_add_spec(self, spec, spec_set=False): ... + class NonCallableMock(Any): + def __new__(cls, *args: Any, **kw: Any) -> Any: ... + def __init__(self, spec: Any=None, wraps: Any=None, name: Any=None, spec_set: Any=None, parent: Any=None, _spec_state: Any=None, _new_name: Any='', _new_parent: Any=None, _spec_as_instance: Any=False, _eat_self: Any=None, unsafe: Any=False, **kwargs: Any) -> None: ... + def attach_mock(self, mock: Any, attribute: Any) -> Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any=False) -> Any: ... return_value = ... # type: Any - @property - def __class__(self): ... + __class__ = ... # type: type called = ... # type: Any call_count = ... # type: Any call_args = ... # type: Any @@ -46,24 +45,25 @@ if sys.version_info >= (3, 3): mock_calls = ... # type: Any side_effect = ... # type: Any method_calls = ... # type: Any - def reset_mock(self, visited=None): ... - def configure_mock(self, **kwargs): ... - def __getattr__(self, name): ... - def __dir__(self): ... - def __setattr__(self, name, value): ... - def __delattr__(self, name): ... - def assert_not_called(_mock_self): ... - def assert_called_with(_mock_self, *args, **kwargs): ... - def assert_called_once_with(_mock_self, *args, **kwargs): ... - def assert_has_calls(self, calls, any_order=False): ... - def assert_any_call(self, *args, **kwargs): ... + def reset_mock(self, visited:bool=None) -> None: ... + def configure_mock(self, **kwargs: Any) -> None: ... + def __getattr__(self, name: Any) -> Any: ... + def __dir__(self) ->Any: ... + def __setattr__(self, name: Any, value: Any) -> None: ... + def __delattr__(self, name: Any) -> None: ... + def assert_not_called(_mock_self) -> None: ... + def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_calls(self, calls: Any, any_order:bool=False)->None: ... + def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... class CallableMixin(Base): side_effect = ... # type: Any - def __init__(self, spec=None, side_effect=None, return_value=..., wraps=None, name=None, spec_set=None, parent=None, _spec_state=None, _new_name='', _new_parent=None, **kwargs): ... - def __call__(_mock_self, *args, **kwargs): ... + def __init__(self, spec:Any=None, side_effect:Any=None, return_value:Any=..., wraps:Any=None, name:Any=None, spec_set:Any=None, parent:Any=None, _spec_state:Any=None, _new_name:Any='', _new_parent:Any=None, **kwargs:Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... - class Mock(CallableMixin, NonCallableMock): ... + class Mock(CallableMixin, NonCallableMock): + def __init__(self) -> None: ... class _patch: attribute_name = ... # type: Any @@ -78,74 +78,76 @@ if sys.version_info >= (3, 3): autospec = ... # type: Any kwargs = ... # type: Any additional_patchers = ... # type: Any - def __init__(self, getter, attribute, new, spec, create, spec_set, autospec, new_callable, kwargs): ... - def copy(self): ... - def __call__(self, func): ... - def decorate_class(self, klass): ... - def decorate_callable(self, func): ... - def get_original(self): ... + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any ) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... target = ... # type: Any temp_original = ... # type: Any is_local = ... # type: Any - def __enter__(self): ... - def __exit__(self, *exc_info): ... - def start(self): ... - def stop(self): ... + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... - def patch(target, new=..., spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs): ... + def patch(target: Any, new: Any=..., spec:Any=None, create:Any=False, spec_set:Any=None, autospec:Any=None, new_callable:Any=None, **kwargs:Any) -> Any: ... class _patch_dict: in_dict = ... # type: Any values = ... # type: Any clear = ... # type: Any - def __init__(self, in_dict, values=..., clear=False, **kwargs): ... - def __call__(self, f): ... - def decorate_class(self, klass): ... - def __enter__(self): ... - def __exit__(self, *args): ... + def __init__(self, in_dict: Any, values:Any=..., clear:Any=False, **kwargs:Any)->None: ... + def __call__(self, f:Any)->Any: ... + def decorate_class(self, klass:Any)->Any: ... + def __enter__(self)->Any: ... + def __exit__(self, *args:Any)->Any: ... start = ... # type: Any stop = ... # type: Any class MagicMixin: - def __init__(self, *args, **kw): ... + def __init__(self, *args:Any, **kw:Any)->None: ... class NonCallableMagicMock(MagicMixin, NonCallableMock): - def mock_add_spec(self, spec, spec_set=False): ... + def __init__(self) -> None: ... + def mock_add_spec(self, spec:Any, spec_set:Any=False)->Any: ... class MagicMock(MagicMixin, Mock): - def mock_add_spec(self, spec, spec_set=False): ... + def __init__(self) -> None: ... + def mock_add_spec(self, spec:Any, spec_set:Any=False)->Any: ... class MagicProxy: name = ... # type: Any parent = ... # type: Any - def __init__(self, name, parent): ... - def __call__(self, *args, **kwargs): ... - def create_mock(self): ... - def __get__(self, obj, _type=None): ... + def __init__(self, name:Any, parent:Any)->None: ... + def __call__(self, *args:Any, **kwargs:Any)->Any: ... + def create_mock(self)->Any: ... + def __get__(self, obj:Any, _type:Any=None)->Any: ... class _ANY: - def __eq__(self, other): ... - def __ne__(self, other): ... + def __eq__(self, other:Any)->bool: ... + def __ne__(self, other:Any)->bool: ... ANY = ... # type: Any class _Call(tuple): - def __new__(cls, value=..., name=None, parent=None, two=False, from_kall=True): ... + def __new__(cls, value:Any=..., name:Any=None, parent:Any=None, two:Any=False, from_kall:Any=True)->Any: ... name = ... # type: Any parent = ... # type: Any from_kall = ... # type: Any - def __init__(self, value=..., name=None, parent=None, two=False, from_kall=True): ... - def __eq__(self, other): ... + def __init__(self, value:Any=..., name:Any=None, parent:Any=None, two:Any=False, from_kall:Any=True)->None: ... + def __eq__(self, other:Any)->bool: ... __ne__ = ... # type: Any - def __call__(self, *args, **kwargs): ... - def __getattr__(self, attr): ... - def count(self, *args, **kwargs): ... - def index(self, *args, **kwargs): ... - def call_list(self): ... + def __call__(self, *args:Any, **kwargs:Any)->Any: ... + def __getattr__(self, attr:Any)->Any: ... + def count(self, *args:Any, **kwargs:Any)->Any: ... + def index(self, *args:Any, **kwargs:Any)->Any: ... + def call_list(self)->Any: ... call = ... # type: Any - def create_autospec(spec, spec_set=False, instance=False, _parent=None, _name=None, **kwargs): ... + def create_autospec(spec: Any, spec_set: Any=False, instance: Any=False, _parent: Any=None, _name: Any=None, **kwargs: Any) -> Any: ... class _SpecState: spec = ... # type: Any @@ -154,10 +156,10 @@ if sys.version_info >= (3, 3): parent = ... # type: Any instance = ... # type: Any name = ... # type: Any - def __init__(self, spec, spec_set=False, parent=None, name=None, ids=None, instance=False): ... + def __init__(self, spec:Any, spec_set:Any=False, parent:Any=None, name:Any=None, ids:Any=None, instance:Any=False)->None: ... - def mock_open(mock=None, read_data=''): ... + def mock_open(mock:Any=None, read_data:Any='')->Any: ... class PropertyMock(Mock): - def __get__(self, obj, obj_type): ... - def __set__(self, obj, val): ... + def __get__(self, obj:Any, obj_type:Any)->Any: ... + def __set__(self, obj:Any, val:Any)->Any: ... From 0a62678a217aef42a0f2f2bff48053d0bb72c68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Tue, 7 Mar 2017 13:38:22 +0000 Subject: [PATCH 2/5] Fix formatting --- stdlib/3/unittest/mock.pyi | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index a78d00283fee..1f9bab56eaa9 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -33,9 +33,9 @@ if sys.version_info >= (3, 3): class NonCallableMock(Any): def __new__(cls, *args: Any, **kw: Any) -> Any: ... - def __init__(self, spec: Any=None, wraps: Any=None, name: Any=None, spec_set: Any=None, parent: Any=None, _spec_state: Any=None, _new_name: Any='', _new_parent: Any=None, _spec_as_instance: Any=False, _eat_self: Any=None, unsafe: Any=False, **kwargs: Any) -> None: ... + def __init__(self, spec: Any = None, wraps: Any = None, name: Any = None, spec_set: Any = None, parent: Any = None, _spec_state: Any = None, _new_name: Any ='', _new_parent: Any = None, _spec_as_instance: Any = False, _eat_self: Any = None, unsafe: Any = False, **kwargs: Any) -> None: ... def attach_mock(self, mock: Any, attribute: Any) -> Any: ... - def mock_add_spec(self, spec: Any, spec_set: Any=False) -> Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ... return_value = ... # type: Any __class__ = ... # type: type called = ... # type: Any @@ -45,7 +45,7 @@ if sys.version_info >= (3, 3): mock_calls = ... # type: Any side_effect = ... # type: Any method_calls = ... # type: Any - def reset_mock(self, visited:bool=None) -> None: ... + def reset_mock(self, visited: bool = None) -> None: ... def configure_mock(self, **kwargs: Any) -> None: ... def __getattr__(self, name: Any) -> Any: ... def __dir__(self) ->Any: ... @@ -54,12 +54,12 @@ if sys.version_info >= (3, 3): def assert_not_called(_mock_self) -> None: ... def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: Any, any_order:bool=False)->None: ... + def assert_has_calls(self, calls: Any, any_order: bool = False)->None: ... def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... class CallableMixin(Base): side_effect = ... # type: Any - def __init__(self, spec:Any=None, side_effect:Any=None, return_value:Any=..., wraps:Any=None, name:Any=None, spec_set:Any=None, parent:Any=None, _spec_state:Any=None, _new_name:Any='', _new_parent:Any=None, **kwargs:Any) -> None: ... + def __init__(self, spec: Any = None, side_effect: Any = None, return_value: Any = ..., wraps: Any = None, name: Any = None, spec_set: Any = None, parent: Any = None, _spec_state: Any = None, _new_name: Any = '', _new_parent: Any = None, **kwargs: Any) -> None: ... def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... class Mock(CallableMixin, NonCallableMock): @@ -92,62 +92,62 @@ if sys.version_info >= (3, 3): def start(self) -> Any: ... def stop(self) -> Any: ... - def patch(target: Any, new: Any=..., spec:Any=None, create:Any=False, spec_set:Any=None, autospec:Any=None, new_callable:Any=None, **kwargs:Any) -> Any: ... + def patch(target: Any, new: Any =..., spec: Any = None, create: Any = False, spec_set: Any = None, autospec: Any = None, new_callable: Any = None, **kwargs: Any) -> Any: ... class _patch_dict: in_dict = ... # type: Any values = ... # type: Any clear = ... # type: Any - def __init__(self, in_dict: Any, values:Any=..., clear:Any=False, **kwargs:Any)->None: ... - def __call__(self, f:Any)->Any: ... - def decorate_class(self, klass:Any)->Any: ... + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = False, **kwargs: Any)->None: ... + def __call__(self, f: Any)->Any: ... + def decorate_class(self, klass: Any)->Any: ... def __enter__(self)->Any: ... - def __exit__(self, *args:Any)->Any: ... + def __exit__(self, *args: Any)->Any: ... start = ... # type: Any stop = ... # type: Any class MagicMixin: - def __init__(self, *args:Any, **kw:Any)->None: ... + def __init__(self, *args: Any, **kw: Any)->None: ... class NonCallableMagicMock(MagicMixin, NonCallableMock): def __init__(self) -> None: ... - def mock_add_spec(self, spec:Any, spec_set:Any=False)->Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any = False)->Any: ... class MagicMock(MagicMixin, Mock): def __init__(self) -> None: ... - def mock_add_spec(self, spec:Any, spec_set:Any=False)->Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any = False)->Any: ... class MagicProxy: name = ... # type: Any parent = ... # type: Any - def __init__(self, name:Any, parent:Any)->None: ... - def __call__(self, *args:Any, **kwargs:Any)->Any: ... + def __init__(self, name: Any, parent: Any)->None: ... + def __call__(self, *args: Any, **kwargs: Any)->Any: ... def create_mock(self)->Any: ... - def __get__(self, obj:Any, _type:Any=None)->Any: ... + def __get__(self, obj: Any, _type: Any = None)->Any: ... class _ANY: - def __eq__(self, other:Any)->bool: ... - def __ne__(self, other:Any)->bool: ... + def __eq__(self, other: Any)->bool: ... + def __ne__(self, other: Any)->bool: ... ANY = ... # type: Any class _Call(tuple): - def __new__(cls, value:Any=..., name:Any=None, parent:Any=None, two:Any=False, from_kall:Any=True)->Any: ... + def __new__(cls, value: Any = ..., name: Any = None, parent: Any = None, two: Any = False, from_kall: Any = True)->Any: ... name = ... # type: Any parent = ... # type: Any from_kall = ... # type: Any - def __init__(self, value:Any=..., name:Any=None, parent:Any=None, two:Any=False, from_kall:Any=True)->None: ... - def __eq__(self, other:Any)->bool: ... + def __init__(self, value: Any = ..., name: Any = None, parent: Any = None, two: Any = False, from_kall: Any = True)->None: ... + def __eq__(self, other: Any)->bool: ... __ne__ = ... # type: Any - def __call__(self, *args:Any, **kwargs:Any)->Any: ... - def __getattr__(self, attr:Any)->Any: ... - def count(self, *args:Any, **kwargs:Any)->Any: ... - def index(self, *args:Any, **kwargs:Any)->Any: ... + def __call__(self, *args: Any, **kwargs: Any)->Any: ... + def __getattr__(self, attr: Any)->Any: ... + def count(self, *args: Any, **kwargs: Any)->Any: ... + def index(self, *args: Any, **kwargs: Any)->Any: ... def call_list(self)->Any: ... call = ... # type: Any - def create_autospec(spec: Any, spec_set: Any=False, instance: Any=False, _parent: Any=None, _name: Any=None, **kwargs: Any) -> Any: ... + def create_autospec(spec: Any, spec_set: Any = False, instance: Any = False, _parent: Any = None, _name: Any = None, **kwargs: Any) -> Any: ... class _SpecState: spec = ... # type: Any @@ -156,10 +156,10 @@ if sys.version_info >= (3, 3): parent = ... # type: Any instance = ... # type: Any name = ... # type: Any - def __init__(self, spec:Any, spec_set:Any=False, parent:Any=None, name:Any=None, ids:Any=None, instance:Any=False)->None: ... + def __init__(self, spec: Any, spec_set: Any = False, parent: Any = None, name: Any = None, ids: Any = None, instance: Any = False)->None: ... - def mock_open(mock:Any=None, read_data:Any='')->Any: ... + def mock_open(mock: Any = None, read_data: Any = '')->Any: ... class PropertyMock(Mock): - def __get__(self, obj:Any, obj_type:Any)->Any: ... - def __set__(self, obj:Any, val:Any)->Any: ... + def __get__(self, obj: Any, obj_type: Any)->Any: ... + def __set__(self, obj: Any, val: Any)->Any: ... From 7cfccaa2c09cd96926e3088cca0e0e005a5a50f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Tue, 7 Mar 2017 13:40:55 +0000 Subject: [PATCH 3/5] Make two and from_kall bool --- stdlib/3/unittest/mock.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index 1f9bab56eaa9..f73473f87444 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -132,11 +132,11 @@ if sys.version_info >= (3, 3): ANY = ... # type: Any class _Call(tuple): - def __new__(cls, value: Any = ..., name: Any = None, parent: Any = None, two: Any = False, from_kall: Any = True)->Any: ... + def __new__(cls, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True)->Any: ... name = ... # type: Any parent = ... # type: Any from_kall = ... # type: Any - def __init__(self, value: Any = ..., name: Any = None, parent: Any = None, two: Any = False, from_kall: Any = True)->None: ... + def __init__(self, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True)->None: ... def __eq__(self, other: Any)->bool: ... __ne__ = ... # type: Any def __call__(self, *args: Any, **kwargs: Any)->Any: ... From 8e6e8d576a146664d41d2c332ae37ef054cc5010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Tue, 7 Mar 2017 13:42:40 +0000 Subject: [PATCH 4/5] Further style fixes --- stdlib/3/unittest/mock.pyi | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index f73473f87444..1e910a14dc46 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -48,13 +48,13 @@ if sys.version_info >= (3, 3): def reset_mock(self, visited: bool = None) -> None: ... def configure_mock(self, **kwargs: Any) -> None: ... def __getattr__(self, name: Any) -> Any: ... - def __dir__(self) ->Any: ... + def __dir__(self) -> Any: ... def __setattr__(self, name: Any, value: Any) -> None: ... def __delattr__(self, name: Any) -> None: ... def assert_not_called(_mock_self) -> None: ... def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: Any, any_order: bool = False)->None: ... + def assert_has_calls(self, calls: Any, any_order: bool = False) -> None: ... def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... class CallableMixin(Base): @@ -98,52 +98,52 @@ if sys.version_info >= (3, 3): in_dict = ... # type: Any values = ... # type: Any clear = ... # type: Any - def __init__(self, in_dict: Any, values: Any = ..., clear: Any = False, **kwargs: Any)->None: ... - def __call__(self, f: Any)->Any: ... - def decorate_class(self, klass: Any)->Any: ... - def __enter__(self)->Any: ... - def __exit__(self, *args: Any)->Any: ... + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = False, **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... start = ... # type: Any stop = ... # type: Any class MagicMixin: - def __init__(self, *args: Any, **kw: Any)->None: ... + def __init__(self, *args: Any, **kw: Any) -> None: ... class NonCallableMagicMock(MagicMixin, NonCallableMock): def __init__(self) -> None: ... - def mock_add_spec(self, spec: Any, spec_set: Any = False)->Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ... class MagicMock(MagicMixin, Mock): def __init__(self) -> None: ... - def mock_add_spec(self, spec: Any, spec_set: Any = False)->Any: ... + def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ... class MagicProxy: name = ... # type: Any parent = ... # type: Any - def __init__(self, name: Any, parent: Any)->None: ... - def __call__(self, *args: Any, **kwargs: Any)->Any: ... - def create_mock(self)->Any: ... - def __get__(self, obj: Any, _type: Any = None)->Any: ... + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Any = None) -> Any: ... class _ANY: - def __eq__(self, other: Any)->bool: ... - def __ne__(self, other: Any)->bool: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... ANY = ... # type: Any class _Call(tuple): - def __new__(cls, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True)->Any: ... + def __new__(cls, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True) -> Any: ... name = ... # type: Any parent = ... # type: Any from_kall = ... # type: Any - def __init__(self, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True)->None: ... - def __eq__(self, other: Any)->bool: ... + def __init__(self, value: Any = ..., name: Any = None, parent: Any = None, two: bool = False, from_kall: bool = True) -> None: ... + def __eq__(self, other: Any) -> bool: ... __ne__ = ... # type: Any - def __call__(self, *args: Any, **kwargs: Any)->Any: ... - def __getattr__(self, attr: Any)->Any: ... - def count(self, *args: Any, **kwargs: Any)->Any: ... - def index(self, *args: Any, **kwargs: Any)->Any: ... - def call_list(self)->Any: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... call = ... # type: Any @@ -156,10 +156,10 @@ if sys.version_info >= (3, 3): parent = ... # type: Any instance = ... # type: Any name = ... # type: Any - def __init__(self, spec: Any, spec_set: Any = False, parent: Any = None, name: Any = None, ids: Any = None, instance: Any = False)->None: ... + def __init__(self, spec: Any, spec_set: Any = False, parent: Any = None, name: Any = None, ids: Any = None, instance: Any = False) -> None: ... - def mock_open(mock: Any = None, read_data: Any = '')->Any: ... + def mock_open(mock: Any = None, read_data: Any = '') -> Any: ... class PropertyMock(Mock): - def __get__(self, obj: Any, obj_type: Any)->Any: ... - def __set__(self, obj: Any, val: Any)->Any: ... + def __get__(self, obj: Any, obj_type: Any) -> Any: ... + def __set__(self, obj: Any, val: Any) -> Any: ... From d130045fb0050d1651d76a18ccafb0852f779277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Wed, 8 Mar 2017 14:28:43 +0000 Subject: [PATCH 5/5] style fixes --- stdlib/3/unittest/mock.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/unittest/mock.pyi b/stdlib/3/unittest/mock.pyi index 1e910a14dc46..5a3f6b00f0c7 100644 --- a/stdlib/3/unittest/mock.pyi +++ b/stdlib/3/unittest/mock.pyi @@ -37,7 +37,7 @@ if sys.version_info >= (3, 3): def attach_mock(self, mock: Any, attribute: Any) -> Any: ... def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ... return_value = ... # type: Any - __class__ = ... # type: type + __class__ = ... # type: type called = ... # type: Any call_count = ... # type: Any call_args = ... # type: Any @@ -81,7 +81,7 @@ if sys.version_info >= (3, 3): def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... def copy(self) -> Any: ... def __call__(self, func: Any) -> Any: ... - def decorate_class(self, klass: Any ) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... def decorate_callable(self, func: Any) -> Any: ... def get_original(self) -> Any: ... target = ... # type: Any