added neotest

This commit is contained in:
Oliver Hartmann 2023-01-03 14:30:34 +01:00
parent 4aa3048e23
commit c8e1906f22

42
lua/plugins/neotest.lua Normal file
View File

@ -0,0 +1,42 @@
return {
'nvim-neotest/neotest',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter',
'antoinemadec/FixCursorHold.nvim',
'nvim-neotest/neotest-python'
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-python")({
dap = {
justMyCode = false
},
args = { "--log-level", "DEBUG" },
runner = 'pytest',
python = '.venv/Scripts/python.exe',
-- is_test_file = function(file_path)
-- return file_path:find("^test_") ~= nil
-- end,
})
}
})
end,
keys = {
{
'<F3>',
function()
require("neotest").run.run()
end,
desc = 'Run nearest test'
},
{
'<S-F3>',
function()
require("neotest").run.run({ strategy = "dap" })
end,
desc = 'Run nearest test'
}
}
}