This PR adds support for conditional arguments per strategy.
This change is necessary in order to add extra arguments or modify them depending on selected strategy. E.g. when project is using pytest-cov and dap strategy is used when running tests, then debugpy is not stopping at breakpoints (see pytest-cov limitiation). PR allows to compare selected strategy in args function to disable coverage when debugging:
require("neotest").setup({
adapters = {
require("neotest-python")({
args = function(runner, position, strategy)
local args = {}
if strategy == "dap" and runner == "pytest" then
args = vim.list_extend(args, { "--no-cov" })
end
return args
end,
}),
},
})
This PR adds support for conditional arguments per strategy.
This change is necessary in order to add extra arguments or modify them depending on selected strategy. E.g. when project is using pytest-cov and dap strategy is used when running tests, then debugpy is not stopping at breakpoints (see pytest-cov limitiation). PR allows to compare selected strategy in args function to disable coverage when debugging: