I get the following error in neotest.log whenever I try to run a single test file or a directory of tests:
WARN | 2024-03-15T23:53:17Z-0700 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:164 | CHILD | Error in remote call ...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:87: '' is not a valid language name
stack traceback:
[C]: in function 'error'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:87: in function 'add'
...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:98: in function 'get_string_parser'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:119: in function 'get_parse_root'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:160: in function 'parse_positions_from_string'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:207: in function 'func'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:156: in function <...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:155>
[C]: in function 'xpcall'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:155: in function <...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:154>
all errors in the log file are the same as above, apart from 2 instances of this:
WARN | 2024-03-15T23:26:14Z-0700 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:164 | CHILD | Error in remote call error converting argument 4
stack traceback:
[C]: in function 'rpcnotify'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:126: in function 'notify'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:165: in function <...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:162>
[C]: in function 'error'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:87: in function 'add'
...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:98: in function 'get_string_parser'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:119: in function 'get_parse_root'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:160: in function 'parse_positions_from_string'
...im-data/lazy/neotest/lua/neotest/lib/treesitter/init.lua:207: in function 'func'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:156: in function <...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:155>
[C]: in function 'xpcall'
...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:155: in function <...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:154>
all of my venvs are in the default poetry directory (rather than in separate project directories). I activate the relevant venv using venv-selector
it seems that test discovery works fine as the summary window shows them all correctly, just nothing happens (apart from the logged error) when I run require("neotest").run.run(vim.fn.expand("%"))
given how often treesitter appears in the log, I also tried recompiling the grammar for python but that didn't fix the problem
Error
I get the following error in neotest.log whenever I try to run a single test file or a directory of tests:
all errors in the log file are the same as above, apart from 2 instances of this:
Details
nvim --version:
The project is managed using Poetry and has the following structure. Running
poetry run pytest
outside of nvim runs fine:Im using lazyvim and have installed neotest using the extras package, but I have also tested this manually with this config:
all of my venvs are in the default poetry directory (rather than in separate project directories). I activate the relevant venv using venv-selector
it seems that test discovery works fine as the summary window shows them all correctly, just nothing happens (apart from the logged error) when I run
require("neotest").run.run(vim.fn.expand("%"))
given how often treesitter appears in the log, I also tried recompiling the grammar for python but that didn't fix the problem