nvim-neotest / nvim-neotest/neotest-python

Error panel sometimes replaces whole buffer?

Open
#47 0 comments 0 reactions 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

I just set up neotest-python after using neotest-rspec without issue.

If I run tests that return an error, about half the time neotest creates a new window at the bottom of the screen and shows the error there correctly. The other half, it'll take over the primary window, show the error there, and shrink the buffer to the height of the error panel.

Perhaps best explained by screen capture. (In video, test works as expected the first time, error occurs 2nd time)

Screen Capture of Issue

A few notes:

  • This doesn't happen in neotest-rspec

  • As mentioned, it happens intermittently (~50% of the time) in neotest-python

  • If no errors are returned, the issue doesn't occur

  • If I have the summary panel open, the error shows up in the summary panel instead of the main buffer

  • Command is triggered by lua require('neotest').run.run() or derivatives (eg: lua require('neotest').run.run(vim.fn.expand('%')))
    `

  • No issues running pytest outside vim

  • My configuration for neotest-python is bare bones. Specifically:

local status_ok, neotest = pcall(require, "neotest")
if not status_ok then
  print("Neotest could not be loaded")
  return
end

local status_ok, neotest_python = pcall(require, "neotest-python")
if not status_ok then
  print("Neotest-python could not be loaded")
  return
end

local status_ok, neotest_rspec= pcall(require, "neotest-rspec")
if not status_ok then
  print("Neotest-rspec could not be loaded")
  return
end

neotest.setup({
  adapters =  {
    neotest_rspec({
      rspec_cmd = function()
        return vim.tbl_flatten({
          "bundle",
          "exec",
          "rspec"
        })
      end
    }),
    neotest_python,
  }
})

Any thoughts appreciated, and thanks for neotest - loving it. :)

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

Start by reproducing the intermittent behavior through lua require('neotest').run.run() or its file-scoped variant, using the reported neotest-python setup and failing pytest runs. Compare the error display with neotest-rspec and with the summary panel open. Done means errors consistently appear in a separate panel without replacing or shrinking the primary buffer.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim, python
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.