From 5288521250f18c7a5539e752d2b0511640011162 Mon Sep 17 00:00:00 2001 From: Sam Castelain Date: Thu, 16 Apr 2026 11:18:36 +0200 Subject: [PATCH] chore: Replace use of deprecated vim.tbl_flatten vim.tbl_flatten is deprecated and will be removed in 0.13. Just replaced it with the recommendation in the deprecation notice. For some reason discovering tests did not work anymore after upgrading from 0.11.x to 0.12.1 even though vim.tbl_flatten still works in this version. Replacing it fixes test discovery for me though and it needs to be done before 0.13 anyway. --- lua/neotest-python/base.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neotest-python/base.lua b/lua/neotest-python/base.lua index 6d4a3d3..ce59bd0 100644 --- a/lua/neotest-python/base.lua +++ b/lua/neotest-python/base.lua @@ -111,7 +111,7 @@ end local function scan_test_function_pattern(runner, config, python_command) local test_function_pattern = "^test" if runner == "pytest" and config.pytest_discovery then - local cmd = vim.tbl_flatten({ python_command, M.get_script_path(), "--pytest-extract-test-name-template" }) + local cmd = vim.iter({ python_command, M.get_script_path(), "--pytest-extract-test-name-template" }):flatten():totable() local _, data = lib.process.run(cmd, { stdout = true, stderr = true }) for line in vim.gsplit(data.stdout, "\n", true) do