We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ee0df9 commit a870de7Copy full SHA for a870de7
1 file changed
pylint/test_kotoha_plugin.py
@@ -0,0 +1,27 @@
1
+import astroid
2
+import pylint.testutils
3
+
4
+import kotoha_plugin
5
6
7
+class TestArgumentListTypeHintChecker(pylint.testutils.CheckerTestCase):
8
+ CHECKER_CLASS = kotoha_plugin.ArgumentListTypeHintChecker
9
10
+ def test_find_argument_list_type_hint(self):
11
+ node = astroid.extract_node("""\
12
+def plus_one(numbers: list[int]) -> list[int]:
13
+ return [n + 1 for n in numbers]
14
+""")
15
16
+ with self.assertAddsMessages(
17
+ pylint.testutils.MessageTest(
18
+ msg_id="avoid-list-arg-type",
19
+ node=node.args.annotations[0],
20
+ args=("list",),
21
+ line=1,
22
+ col_offset=22,
23
+ end_line=1,
24
+ end_col_offset=31,
25
+ )
26
+ ):
27
+ self.checker.visit_arguments(node.args)
0 commit comments