Skip to content

Commit ae0225d

Browse files
committed
Detect pytest from pyproject.toml
1 parent ff7d6cb commit ae0225d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lua/dap-python.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ local function default_runner()
2727
return 'pytest'
2828
elseif uv.fs_stat('manage.py') then
2929
return 'django'
30+
elseif uv.fs_stat("pyproject.toml") then
31+
local f = io.open("pyproject.toml")
32+
if f then
33+
for line in f:lines() do
34+
if line:find("%[tool.pytest") then
35+
f:close()
36+
return "pytest"
37+
end
38+
end
39+
f:close()
40+
end
3041
else
3142
return 'unittest'
3243
end

0 commit comments

Comments
 (0)