nvim-neotest / neotest-python

MIT License
128 stars 39 forks source link

failing to run tests after upgrading neotest-python #81

Closed dgarridoa closed 1 week ago

dgarridoa commented 1 week ago

Hi,

Since the 0ab9ad357075b8a7b516bf736b40854751b75845 commit I started to get the following error when I try to run any test:

neotest-python: .../nvim/lazy/neotest-python/lua/neotest-python/adapter.lua:104: attempt to call field 'iter' (a nil value)
stack traceback:
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:89: in function 'iter'
        .../nvim/lazy/neotest-python/lua/neotest-python/adapter.lua:104: in function 'build_spec'
        ...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:76: in function '_run_tree'
        ...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:65: in function <...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:22>
        [C]: in function 'xpcall'
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:84: in function 'run_tree'
        ...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:85: in function 'func'
        ...rridoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:173: in function <...rridoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:172>

config with all latest versions

{
  "nvim-neotest/neotest",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-neotest/nvim-nio",
    "antoinemadec/FixCursorHold.nvim",
    "nvim-treesitter/nvim-treesitter",
    "nvim-neotest/neotest-python",
  }
}
require("neotest").setup({
  adapters = {
    require("neotest-python")({
        dap = { justMyCode = false },
        args = {"--log-level", "DEBUG"},
        runner = "pytest",
        pytest_discover_instances = true,
    })
  }
})

Additional dependency versions

ubuntu 23.04
nvim v0.9.5

Downgrading to 2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50 solves the problem to me.

dpetka2001 commented 1 week ago

Upgrade to Neovim stable 0.10.1 and that should solve your problem.

dgarridoa commented 1 week ago

Upgrading Neovim solves the issue, thanks!