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 2020TYPE_ERR_MSG = '"Dict[<nothing>, <nothing>]" has no attribute "append"'
2121
2222TEST_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+ )
2326
2427windows_flag : Dict [str , int ] = (
2528 {"creationflags" : subprocess .CREATE_NO_WINDOW } if os .name == "nt" else {} # type: ignore
@@ -82,6 +85,15 @@ def test_parse_full_line(workspace):
8285 assert diag ["code" ] == "attr-defined"
8386
8487
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+
8597def test_multiple_workspaces (tmpdir , last_diagnostics_monkeypatch ):
8698 DOC_SOURCE = """
8799def foo():
You can’t perform that action at this time.
0 commit comments