palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

test "test_flake8_no_checked_file" failing on python 3.9 #825

Closed nonamedotc closed 4 years ago

nonamedotc commented 4 years ago

In trying to build pyls on Fedora rawhide (to be 33), I get the test failure below -

config = <pyls.config.config.Config object at 0xec7c6418>
    def test_flake8_no_checked_file(config):
        # A bad uri or a non-saved file may cause the flake8 linter to do nothing.
        # In this situtation, the linter will return an empty list.

        doc = Document('', DOC)
        diags = flake8_lint.pyls_lint(config, doc)
>       assert diags == []
E       assert [{'code': 'E9...ity': 2, ...}] == []
E         Left contains one more item: {'code': 'E902', 'message': "FileNotFoundError: [Errno 2] No such file or directory: ''", 'range': {'end': {'character': 10, 'line': -1}, 'start': {'character': 0, 'line': -1}}, 'severity': 2, ...}
E         Full diff:
E           [
E         -  ,
E         +  {'code': 'E902',
E         +   'message': "FileNotFoundError: [Errno 2] No such file or directory: ''",
E         +   'range': {'end': {'character': 10,...
E         
E         ...Full output truncated (7 lines hidden), use '-vv' to show
test/plugins/test_flake8_lint.py:37: AssertionError

Versions of dependencies are here - https://kojipkgs.fedoraproject.org//work/tasks/1161/46111161/root.log

I can provide other info as needed and/or test patches.

ccordoba12 commented 4 years ago

Please submit a pull request with a fix for this.