diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua new file mode 100644 index 0000000..363a9eb --- /dev/null +++ b/lua/plugins/neotest.lua @@ -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 = { + { + '', + function() + require("neotest").run.run() + end, + desc = 'Run nearest test' + }, + { + '', + function() + require("neotest").run.run({ strategy = "dap" }) + end, + desc = 'Run nearest test' + } + } +}