nvim-neotest / neotest-python

MIT License
132 stars 40 forks source link

neotest-python not working with unittest #64

Open joshyt100 opened 8 months ago

joshyt100 commented 8 months ago

This is my neotest setup: require("neotest").setup({ adapters = { require("neotest-python")({ -- Extra arguments for nvim-dap configuration -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values dap = { justMyCode = false, console = "integratedTerminal", }, args = { "--log-level", "DEBUG", "--quiet" }, runner = "unittest", }) } I am able to get it to work with pytest, but I can't figure out how to use it with unittest. What am I doing wrong?

rcarriga commented 8 months ago

Are you using the latest master commit? There was a bug fixed in #62 that could be the issue. If that is not the problem, please provide the information requested in the neotest bug report template

joshyt100 commented 8 months ago

This is how I have everything setup. I'm also using lunarvim.

lvim.plugins = {

"mfussenegger/nvim-dap-python", "nvim-neotest/neotest", "nvim-neotest/neotest-python" }

lvim.builtin.dap.active = true local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") pcall(function() require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") end)

require("neotest").setup({ adapters = { require("neotest-python")({ dap = { justMyCode = false, console = "integratedTerminal", }, args = { "--log-level", "DEBUG", "--quiet" }, runner = "unittest", }) } })

afrischk commented 8 months ago

I assume you are using venv. If in your code base, can you suspend lunarvim (ctrl+z), open the python interpreter and try to import unittest. Does this work?

Are there any logs you can provide? Which python version are you using?