nvim-neotest / nvim-neotest/neotest-python

Setting suite to true for neotest throws callback error

Open
#80 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
192
Forks
60
PR merge metrics
No merged PRs in 30d

Description

If you enable suite to true: eg.

function M.run_all_tests()
  -- Run all found test files
  require("neotest").run.run(vim.fn.getcwd(), true)
  -- Open the output panel
  require("neotest").output_panel.open()
end

The test suite will run all the unit tests, but it will also result in the following callback:

Error executing luv callback:
...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:105: attempt to call upvalue 'cb' (a boolean value)
stack traceback:
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:105: in function 'close_task'
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:127: in function 'cb'
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:188: in function 'waiter'
        ...lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/control.lua:57: in function 'set'
        ...re/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/init.lua:109: in function 'cb'
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:105: in function 'close_task'
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:127: in function 'cb'
        ...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:188: in function <...e/lunarvim/site/pack/lazy/opt/nvim-nio/lua/nio/tasks.lua:187>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the error with the shown require("neotest").run.run(vim.fn.getcwd(), true) entry point, then trace how the suite boolean reaches nvim-nio's nio/tasks.lua callback handling. Done means running the full suite no longer produces the callback error; add or run a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.