Skip to content

Commit

Permalink
Detect pytest from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger committed Jun 3, 2024
1 parent ff7d6cb commit ae0225d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lua/dap-python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ local function default_runner()
return 'pytest'
elseif uv.fs_stat('manage.py') then
return 'django'
elseif uv.fs_stat("pyproject.toml") then
local f = io.open("pyproject.toml")
if f then
for line in f:lines() do
if line:find("%[tool.pytest") then
f:close()
return "pytest"
end
end
f:close()
end
else
return 'unittest'
end
Expand Down

0 comments on commit ae0225d

Please sign in to comment.