added neotest
This commit is contained in:
parent
4aa3048e23
commit
c8e1906f22
42
lua/plugins/neotest.lua
Normal file
42
lua/plugins/neotest.lua
Normal 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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user