File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -489,3 +489,29 @@ def visit_assname(self, node: nodes.NodeNG) -> None:
489
489
records [0 ].message .args [0 ]
490
490
== "utils.check_messages will be removed in favour of calling utils.only_required_for_messages in pylint 3.0"
491
491
)
492
+
493
+
494
+ def test_is_typing_literal () -> None :
495
+ code = astroid .extract_node (
496
+ """
497
+ from typing import Literal as Lit, Set as Literal
498
+ import typing as t
499
+
500
+ Literal #@
501
+ Lit #@
502
+ t.Literal #@
503
+ """
504
+ )
505
+
506
+ assert not utils .is_typing_literal (code [0 ])
507
+ assert utils .is_typing_literal (code [1 ])
508
+ assert utils .is_typing_literal (code [2 ])
509
+
510
+ code = astroid .extract_node (
511
+ """
512
+ Literal #@
513
+ typing.Literal #@
514
+ """
515
+ )
516
+ assert not utils .is_typing_literal (code [0 ])
517
+ assert not utils .is_typing_literal (code [1 ])
You can’t perform that action at this time.
0 commit comments