feat: remove file searching
This commit is contained in:
@@ -32,7 +32,7 @@ local get_runner = function()
|
||||
end
|
||||
|
||||
---@type NeotestAdapter
|
||||
local PythonNeotestAdapter = {name = "neotest-python"}
|
||||
local PythonNeotestAdapter = { name = "neotest-python" }
|
||||
|
||||
function PythonNeotestAdapter.is_test_file(file_path)
|
||||
return base.is_test_file(file_path)
|
||||
@@ -41,7 +41,6 @@ end
|
||||
---@async
|
||||
---@return Tree | nil
|
||||
function PythonNeotestAdapter.discover_positions(path)
|
||||
if path and not lib.files.is_dir(path) then
|
||||
local query = [[
|
||||
((function_definition
|
||||
name: (identifier) @test.name)
|
||||
@@ -55,9 +54,6 @@ function PythonNeotestAdapter.discover_positions(path)
|
||||
return lib.treesitter.parse_positions(path, query, {
|
||||
require_namespaces = get_runner() == "unittest",
|
||||
})
|
||||
end
|
||||
local files = lib.func_util.filter_list(base.is_test_file, lib.files.find({ path }))
|
||||
return lib.files.parse_dir_from_files(path, files)
|
||||
end
|
||||
|
||||
---@param args NeotestRunArgs
|
||||
|
Reference in New Issue
Block a user