Skip to content

Commit 2b72cf5

Browse files
committed
Improve test so we are sure the exclude section has this side-effect
1 parent cbe87e9 commit 2b72cf5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test_plugin.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,15 @@ def foo():
330330
assert diag["code"] == "unreachable"
331331

332332

333-
def test_exclude_path_match_mypy_not_run(tmpdir, workspace):
333+
def test_config_exclude(tmpdir, workspace):
334334
"""When exclude is set in config then mypy should not run for that file."""
335335
doc = Document(DOC_URI, workspace, DOC_TYPE_ERR)
336336

337337
plugin.pylsp_settings(workspace._config)
338-
workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {"exclude": [doc.path]}}}})
338+
workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {}}}})
339339
diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False)
340+
assert diags[0]["message"] == TYPE_ERR_MSG
340341

341-
assert not diags
342+
workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {"exclude": [doc.path]}}}})
343+
diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False)
344+
assert diags == []

0 commit comments

Comments
 (0)