Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neotest-python not working with unittest #64

Open
joshyt100 opened this issue Jan 15, 2024 · 3 comments
Open

neotest-python not working with unittest #64

joshyt100 opened this issue Jan 15, 2024 · 3 comments

Comments

@joshyt100
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Contributor

afrischk commented Jan 31, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants