File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 20
20
TYPE_ERR_MSG = '"Dict[<nothing>, <nothing>]" has no attribute "append"'
21
21
22
22
TEST_LINE = 'test_plugin.py:279:8:279:16: error: "Request" has no attribute "id" [attr-defined]'
23
+ TEST_LINE_NOTE = (
24
+ 'test_plugin.py:124:1:129:77: note: Use "-> None" if function does not return a value'
25
+ )
23
26
24
27
windows_flag : Dict [str , int ] = (
25
28
{"creationflags" : subprocess .CREATE_NO_WINDOW } if os .name == "nt" else {} # type: ignore
@@ -82,6 +85,15 @@ def test_parse_full_line(workspace):
82
85
assert diag ["code" ] == "attr-defined"
83
86
84
87
88
+ def test_parse_note_line (workspace ):
89
+ diag = plugin .parse_line (TEST_LINE_NOTE )
90
+ assert diag ["message" ] == 'Use "-> None" if function does not return a value'
91
+ assert diag ["range" ]["start" ] == {"line" : 123 , "character" : 0 }
92
+ assert diag ["range" ]["end" ] == {"line" : 128 , "character" : 77 }
93
+ assert diag ["severity" ] == 3
94
+ assert diag ["code" ] == None
95
+
96
+
85
97
def test_multiple_workspaces (tmpdir , last_diagnostics_monkeypatch ):
86
98
DOC_SOURCE = """
87
99
def foo():
You can’t perform that action at this time.
0 commit comments