diff --git a/test/test_plugin.py b/test/test_plugin.py index 237d8f5..5e39141 100644 --- a/test/test_plugin.py +++ b/test/test_plugin.py @@ -330,12 +330,15 @@ def foo(): assert diag["code"] == "unreachable" -def test_exclude_path_match_mypy_not_run(tmpdir, workspace): +def test_config_exclude(tmpdir, workspace): """When exclude is set in config then mypy should not run for that file.""" doc = Document(DOC_URI, workspace, DOC_TYPE_ERR) plugin.pylsp_settings(workspace._config) - workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {"exclude": [doc.path]}}}}) + workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {}}}}) diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False) + assert diags[0]["message"] == TYPE_ERR_MSG - assert not diags + workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {"exclude": [doc.path]}}}}) + diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False) + assert diags == []