Skip to content

Commit b21f707

Browse files
Handle backward slash on windows in unittest runner (#96)
Co-authored-by: bartsteensma <b.steensma@fleetcleaner.com>
1 parent af5e04c commit b21f707

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lua/dap-python.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ end
100100

101101
---@private
102102
function M.test_runners.unittest(classname, methodname)
103-
local path = vim.fn.expand('%:.:r:gs?/?.?')
103+
local path
104+
if is_windows() then
105+
path = vim.fn.expand('%:.:r:gs?\\?.?')
106+
else
107+
path = vim.fn.expand('%:.:r:gs?/?.?')
108+
end
104109
local test_path = table.concat(prune_nil({path, classname, methodname}), '.')
105110
local args = {'-v', test_path}
106111
return 'unittest', args

0 commit comments

Comments
 (0)