diff options
author | Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> | 2022-08-21 07:23:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-21 07:23:32 +0200 |
commit | 29e74e45cfe7922fc97012c3c14b7e4b319d45be (patch) | |
tree | 4f46740115904c5c89f19105afedb89d83a81b37 | |
parent | 2fafadc8aca1831c594cafd35a46b691eaa3e357 (diff) | |
download | pylint-git-29e74e45cfe7922fc97012c3c14b7e4b319d45be.tar.gz |
Add a functional test for the `useless-parent-delegation` checker. (#7326)
Closes #7287
-rw-r--r-- | tests/functional/u/useless/useless_parent_delegation.py | 12 | ||||
-rw-r--r-- | tests/functional/u/useless/useless_parent_delegation.txt | 50 |
2 files changed, 37 insertions, 25 deletions
diff --git a/tests/functional/u/useless/useless_parent_delegation.py b/tests/functional/u/useless/useless_parent_delegation.py index 20675e524..e9d6432f3 100644 --- a/tests/functional/u/useless/useless_parent_delegation.py +++ b/tests/functional/u/useless/useless_parent_delegation.py @@ -2,6 +2,7 @@ # pylint: disable=too-few-public-methods, unused-argument, invalid-name, too-many-public-methods # pylint: disable=line-too-long, arguments-out-of-order # pylint: disable=super-with-arguments, dangerous-default-value +# pylint: disable=too-many-function-args, no-method-argument import random from typing import Any, List @@ -413,3 +414,14 @@ class ReturnTypeSame(ReturnTypeAny): def draw(self) -> Any: # [useless-parent-delegation] return super().draw() + + +# Any number of positional arguments followed by one keyword argument with a default value +class Fruit: + def __init__(*, tastes_bitter=None): + ... + + +class Lemon(Fruit): + def __init__(*, tastes_bitter=True): + super().__init__(tastes_bitter=tastes_bitter) diff --git a/tests/functional/u/useless/useless_parent_delegation.txt b/tests/functional/u/useless/useless_parent_delegation.txt index 2d79897f8..091702173 100644 --- a/tests/functional/u/useless/useless_parent_delegation.txt +++ b/tests/functional/u/useless/useless_parent_delegation.txt @@ -1,25 +1,25 @@ -useless-parent-delegation:220:4:220:25:UselessSuper.equivalent_params:Useless parent or super() delegation in method 'equivalent_params':INFERENCE -useless-parent-delegation:223:4:223:27:UselessSuper.equivalent_params_1:Useless parent or super() delegation in method 'equivalent_params_1':INFERENCE -useless-parent-delegation:226:4:226:27:UselessSuper.equivalent_params_2:Useless parent or super() delegation in method 'equivalent_params_2':INFERENCE -useless-parent-delegation:229:4:229:27:UselessSuper.equivalent_params_3:Useless parent or super() delegation in method 'equivalent_params_3':INFERENCE -useless-parent-delegation:232:4:232:27:UselessSuper.equivalent_params_4:Useless parent or super() delegation in method 'equivalent_params_4':INFERENCE -useless-parent-delegation:235:4:235:27:UselessSuper.equivalent_params_5:Useless parent or super() delegation in method 'equivalent_params_5':INFERENCE -useless-parent-delegation:238:4:238:27:UselessSuper.equivalent_params_6:Useless parent or super() delegation in method 'equivalent_params_6':INFERENCE -useless-parent-delegation:241:4:241:29:UselessSuper.with_default_argument:Useless parent or super() delegation in method 'with_default_argument':INFERENCE -useless-parent-delegation:245:4:245:32:UselessSuper.without_default_argument:Useless parent or super() delegation in method 'without_default_argument':INFERENCE -useless-parent-delegation:248:4:248:34:UselessSuper.with_default_argument_none:Useless parent or super() delegation in method 'with_default_argument_none':INFERENCE -useless-parent-delegation:252:4:252:33:UselessSuper.with_default_argument_int:Useless parent or super() delegation in method 'with_default_argument_int':INFERENCE -useless-parent-delegation:255:4:255:35:UselessSuper.with_default_argument_tuple:Useless parent or super() delegation in method 'with_default_argument_tuple':INFERENCE -useless-parent-delegation:258:4:258:34:UselessSuper.with_default_argument_dict:Useless parent or super() delegation in method 'with_default_argument_dict':INFERENCE -useless-parent-delegation:261:4:261:33:UselessSuper.with_default_argument_var:Useless parent or super() delegation in method 'with_default_argument_var':INFERENCE -useless-parent-delegation:264:4:264:16:UselessSuper.__init__:Useless parent or super() delegation in method '__init__':INFERENCE -useless-parent-delegation:267:4:267:24:UselessSuper.with_default_arg:Useless parent or super() delegation in method 'with_default_arg':INFERENCE -useless-parent-delegation:270:4:270:28:UselessSuper.with_default_arg_bis:Useless parent or super() delegation in method 'with_default_arg_bis':INFERENCE -useless-parent-delegation:273:4:273:28:UselessSuper.with_default_arg_ter:Useless parent or super() delegation in method 'with_default_arg_ter':INFERENCE -useless-parent-delegation:276:4:276:29:UselessSuper.with_default_arg_quad:Useless parent or super() delegation in method 'with_default_arg_quad':INFERENCE -useless-parent-delegation:310:4:310:16:DecoratedList.__hash__:Useless parent or super() delegation in method '__hash__':INFERENCE -useless-parent-delegation:336:4:336:16:SubTwoOne.__init__:Useless parent or super() delegation in method '__init__':INFERENCE -useless-parent-delegation:359:4:359:15:UselessSuperPy3.useless:Useless parent or super() delegation in method 'useless':INFERENCE -useless-parent-delegation:374:4:374:16:Ham.__init__:Useless parent or super() delegation in method '__init__':INFERENCE -useless-parent-delegation:407:4:407:12:ReturnTypeSpecified.draw:Useless parent or super() delegation in method 'draw':INFERENCE -useless-parent-delegation:414:4:414:12:ReturnTypeSame.draw:Useless parent or super() delegation in method 'draw':INFERENCE +useless-parent-delegation:221:4:221:25:UselessSuper.equivalent_params:Useless parent or super() delegation in method 'equivalent_params':INFERENCE +useless-parent-delegation:224:4:224:27:UselessSuper.equivalent_params_1:Useless parent or super() delegation in method 'equivalent_params_1':INFERENCE +useless-parent-delegation:227:4:227:27:UselessSuper.equivalent_params_2:Useless parent or super() delegation in method 'equivalent_params_2':INFERENCE +useless-parent-delegation:230:4:230:27:UselessSuper.equivalent_params_3:Useless parent or super() delegation in method 'equivalent_params_3':INFERENCE +useless-parent-delegation:233:4:233:27:UselessSuper.equivalent_params_4:Useless parent or super() delegation in method 'equivalent_params_4':INFERENCE +useless-parent-delegation:236:4:236:27:UselessSuper.equivalent_params_5:Useless parent or super() delegation in method 'equivalent_params_5':INFERENCE +useless-parent-delegation:239:4:239:27:UselessSuper.equivalent_params_6:Useless parent or super() delegation in method 'equivalent_params_6':INFERENCE +useless-parent-delegation:242:4:242:29:UselessSuper.with_default_argument:Useless parent or super() delegation in method 'with_default_argument':INFERENCE +useless-parent-delegation:246:4:246:32:UselessSuper.without_default_argument:Useless parent or super() delegation in method 'without_default_argument':INFERENCE +useless-parent-delegation:249:4:249:34:UselessSuper.with_default_argument_none:Useless parent or super() delegation in method 'with_default_argument_none':INFERENCE +useless-parent-delegation:253:4:253:33:UselessSuper.with_default_argument_int:Useless parent or super() delegation in method 'with_default_argument_int':INFERENCE +useless-parent-delegation:256:4:256:35:UselessSuper.with_default_argument_tuple:Useless parent or super() delegation in method 'with_default_argument_tuple':INFERENCE +useless-parent-delegation:259:4:259:34:UselessSuper.with_default_argument_dict:Useless parent or super() delegation in method 'with_default_argument_dict':INFERENCE +useless-parent-delegation:262:4:262:33:UselessSuper.with_default_argument_var:Useless parent or super() delegation in method 'with_default_argument_var':INFERENCE +useless-parent-delegation:265:4:265:16:UselessSuper.__init__:Useless parent or super() delegation in method '__init__':INFERENCE +useless-parent-delegation:268:4:268:24:UselessSuper.with_default_arg:Useless parent or super() delegation in method 'with_default_arg':INFERENCE +useless-parent-delegation:271:4:271:28:UselessSuper.with_default_arg_bis:Useless parent or super() delegation in method 'with_default_arg_bis':INFERENCE +useless-parent-delegation:274:4:274:28:UselessSuper.with_default_arg_ter:Useless parent or super() delegation in method 'with_default_arg_ter':INFERENCE +useless-parent-delegation:277:4:277:29:UselessSuper.with_default_arg_quad:Useless parent or super() delegation in method 'with_default_arg_quad':INFERENCE +useless-parent-delegation:311:4:311:16:DecoratedList.__hash__:Useless parent or super() delegation in method '__hash__':INFERENCE +useless-parent-delegation:337:4:337:16:SubTwoOne.__init__:Useless parent or super() delegation in method '__init__':INFERENCE +useless-parent-delegation:360:4:360:15:UselessSuperPy3.useless:Useless parent or super() delegation in method 'useless':INFERENCE +useless-parent-delegation:375:4:375:16:Ham.__init__:Useless parent or super() delegation in method '__init__':INFERENCE +useless-parent-delegation:408:4:408:12:ReturnTypeSpecified.draw:Useless parent or super() delegation in method 'draw':INFERENCE +useless-parent-delegation:415:4:415:12:ReturnTypeSame.draw:Useless parent or super() delegation in method 'draw':INFERENCE |