GeezerVison is showing github.com — Running tests gives an error and never exits · Issue #679 · python-lsp/python-lsp-server
Running tests gives an error and never exits #679DescriptionAfter commit 3b1c895, running the test suite with pytest -v gives an error in test_missing_message, and the pytests process never exits after printing the errors, it needs to be interrupted
ERROR test/test_language_server.py::test_missing_message - pylsp_jsonrpc.exceptions.JsonRpcInvalidParams: AttributeError: 'NoneType' object has no attribute 'plugin_manager'
Full error log:
_______________________________________________________ ERROR at teardown of test_missing_message ________________________________________________________
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
^^^^^^^^^^^^^^^^^^^^^^^^
)
/usr/lib/python3.13/site-packages/flaky/flaky_pytest_plugin.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/fixtures.py:177: in client_server_pair
).result(timeout=CALL_TIMEOUT_IN_SECONDS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.13/concurrent/futures/_base.py:456: in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = None
def __get_result(self):
if self._exception is not None:
try:
> raise self._exception
E pylsp_jsonrpc.exceptions.JsonRpcInvalidParams: AttributeError: 'NoneType' object has no attribute 'plugin_manager'
/usr/lib/python3.13/concurrent/futures/_base.py:401: JsonRpcInvalidParams
------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------
2025-10-13 12:29:35,614 CEST - ERROR - pylsp_jsonrpc.endpoint - Failed to handle request 26ef3d3d-1984-43ad-9e92-fd96bca36be0
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 193, in _handle_request
handler = self._dispatcher[method]
~~~~~~~~~~~~~~~~^^^^^^^^
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 235, in __getitem__
raise KeyError()
KeyError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 117, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 195, in _handle_request
raise JsonRpcMethodNotFound.of(method) from e
pylsp_jsonrpc.exceptions.JsonRpcMethodNotFound: Method Not Found: unknown_method
------------------------------------------------------------------- Captured log call --------------------------------------------------------------------
ERROR pylsp_jsonrpc.endpoint:endpoint.py:119 Failed to handle request 26ef3d3d-1984-43ad-9e92-fd96bca36be0
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 193, in _handle_request
handler = self._dispatcher[method]
~~~~~~~~~~~~~~~~^^^^^^^^
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 235, in __getitem__
raise KeyError()
KeyError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 117, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 195, in _handle_request
raise JsonRpcMethodNotFound.of(method) from e
pylsp_jsonrpc.exceptions.JsonRpcMethodNotFound: Method Not Found: unknown_method
---------------------------------------------------------------- Captured stderr teardown ----------------------------------------------------------------
2025-10-13 12:29:35,617 CEST - ERROR - pylsp_jsonrpc.endpoint - Failed to handle request ceb5ba62-8bb1-4f7d-bf7e-523becfa94e9
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 117, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 197, in _handle_request
handler_result = handler(params)
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/dispatchers.py", line 25, in handler
return method(**(params or {}))
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 240, in m_shutdown
self._hook("pylsp_shutdown")
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 266, in _hook
hook_handlers = self.config.plugin_manager.subset_hook_caller(
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'plugin_manager'
----------------------------------------------------------------- Captured log teardown ------------------------------------------------------------------
ERROR pylsp_jsonrpc.endpoint:endpoint.py:126 Failed to handle request ceb5ba62-8bb1-4f7d-bf7e-523becfa94e9
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 117, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/endpoint.py", line 197, in _handle_request
handler_result = handler(params)
File "/usr/lib/python3.13/site-packages/pylsp_jsonrpc/dispatchers.py", line 25, in handler
return method(**(params or {}))
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 240, in m_shutdown
self._hook("pylsp_shutdown")
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/home/antonio/Software/test/python-lsp-server/pylsp/python_lsp.py", line 266, in _hook
hook_handlers = self.config.plugin_manager.subset_hook_caller(
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'plugin_manager'
Activityaeliton commented on Nov 20, 2025 I also hit this one running the tests locally. aeliton commented on Nov 21, 2025 The problem is on test/test_language_server.py, test_missing_message. This had affected the CI originally, as we can see the test being skipped, but it's clearly not a CI only problem...
diff --git a/test/test_language_server.py b/test/test_language_server.py
index 9b36211..2b41ba9 100644
--- a/test/test_language_server.py
+++ b/test/test_language_server.py
@@ -77,7 +77,7 @@ def test_not_exit_without_check_parent_process_flag(
@flaky(max_runs=10, min_passes=1)
[email protected](RUNNING_IN_CI, reason="This test is hanging on CI")
[email protected](reason="This test is hanging on CI")
def test_missing_message(client_server_pair) -> None:
client, _ = client_server_pair
with pytest.raises(JsonRpcMethodNotFound):
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|