From 1323c5ff09f28eff28f3ca733f5949ffd2039b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Mon, 17 Jan 2022 09:49:15 +0000 Subject: [PATCH] feat: root finder --- lua/neotest-python/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/neotest-python/init.lua b/lua/neotest-python/init.lua index fc7b294..fd729ca 100644 --- a/lua/neotest-python/init.lua +++ b/lua/neotest-python/init.lua @@ -34,6 +34,8 @@ end ---@type NeotestAdapter local PythonNeotestAdapter = { name = "neotest-python" } +PythonNeotestAdapter.root = lib.files.match_root_pattern("pyproject.toml", "setup.cfg", "mypy.ini", "pytest.ini", "setup.py") + function PythonNeotestAdapter.is_test_file(file_path) return base.is_test_file(file_path) end @@ -125,4 +127,3 @@ setmetatable(PythonNeotestAdapter, { }) return PythonNeotestAdapter -