Closed Zeioth closed 1 year ago
After checking here
I've tried to run
lua print(require("neotest-python").is_test_file(vim.fn.expand("%:p")))
And it returns true on my file helper_test.py
but it still returns No test found
Apologies, it works correctly with this neotest config:
{
"nvim-neotest/neotest",
ft = { "go", "rust", "python", "cs", "typescript", "javascript" },
dependencies = {
"nvim-neotest/neotest-go",
"nvim-neotest/neotest-python",
"rouge8/neotest-rust",
"Issafalcon/neotest-dotnet",
"nvim-neotest/neotest-jest",
},
opts = function()
return {
-- your neotest config here
adapters = {
require "neotest-dotnet",
require "neotest-python",
require "neotest-rust",
require "neotest-go",
require "neotest-jest",
},
}
end,
config = function(_, opts)
-- get neotest namespace (api call creates or returns namespace)
local neotest_ns = vim.api.nvim_create_namespace "neotest"
vim.diagnostic.config({
virtual_text = {
format = function(diagnostic)
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
return message
end,
},
}, neotest_ns)
require("neotest").setup(opts)
end,
},
Closing.
I have the program
And the pytest test:
But when I open the test file, and run
lua require("neotest").run.run()
I getNo tests found
I have pytest installed on my machine. What I'm missing?
My neotest config is
EDIT: I forgot to mention I can run
pytest
on my project directory, and that runs the test correctly.