diff --git a/lua/neotest-python/pytest.lua b/lua/neotest-python/pytest.lua index 3b3e950..ad24278 100644 --- a/lua/neotest-python/pytest.lua +++ b/lua/neotest-python/pytest.lua @@ -88,6 +88,7 @@ local function get_socket_path(cmd, messages, callback) else callback(err_read, data) end + client:close() end) end) end diff --git a/neotest_python/params_getter.py b/neotest_python/params_getter.py index 1f21eab..ed75931 100644 --- a/neotest_python/params_getter.py +++ b/neotest_python/params_getter.py @@ -136,12 +136,12 @@ async def serve_socket(): if python_socket_path.exists(): print(python_socket_path) + return atexit.register(lambda: _close_socket(python_socket_path)) signal.signal(signal.SIGTERM, lambda x, _: _close_socket(python_socket_path)) signal.signal(signal.SIGINT, lambda x, _: _close_socket(python_socket_path)) - # signal.signal(signal.SIGKILL, lambda x, _: _close_socket(python_socket_path)) async def handle_client(reader: asyncio.StreamReader, writer: asyncio.StreamWriter): path = await reader.readline()