diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/m/missing_kwoa_py3.py | 39 | ||||
-rw-r--r-- | tests/functional/m/missing_kwoa_py3.txt | 6 |
2 files changed, 41 insertions, 4 deletions
diff --git a/tests/functional/m/missing_kwoa_py3.py b/tests/functional/m/missing_kwoa_py3.py index 3b6e1c0d8..b4dc604cd 100644 --- a/tests/functional/m/missing_kwoa_py3.py +++ b/tests/functional/m/missing_kwoa_py3.py @@ -1,4 +1,6 @@ -# pylint: disable=missing-docstring,unused-argument +# pylint: disable=missing-docstring,unused-argument,too-few-public-methods +import typing + def target(pos, *, keyword): return pos + keyword @@ -34,3 +36,38 @@ def other_function(**kwargs): other_function(param=2) + + +class Parent: + + @typing.overload + def __init__( self, *, first, second, third): + pass + + @typing.overload + def __init__(self, *, first, second): + pass + + @typing.overload + def __init__(self, *, first): + pass + + def __init__( + self, + *, + first, + second: typing.Optional[str] = None, + third: typing.Optional[str] = None): + self._first = first + self._second = second + self._third = third + + +class Child(Parent): + def __init__( + self, + *, + first, + second): + super().__init__(first=first, second=second) + self._first = first + second diff --git a/tests/functional/m/missing_kwoa_py3.txt b/tests/functional/m/missing_kwoa_py3.txt index b9d6baac5..e65581f25 100644 --- a/tests/functional/m/missing_kwoa_py3.txt +++ b/tests/functional/m/missing_kwoa_py3.txt @@ -1,3 +1,3 @@ -missing-kwoa:19:not_forwarding_kwargs:Missing mandatory keyword argument 'keyword' in function call -missing-kwoa:25::Missing mandatory keyword argument 'keyword' in function call -too-many-function-args:25::Too many positional arguments for function call +missing-kwoa:21:not_forwarding_kwargs:Missing mandatory keyword argument 'keyword' in function call +missing-kwoa:27::Missing mandatory keyword argument 'keyword' in function call +too-many-function-args:27::Too many positional arguments for function call |