nvim-neotest / nvim-neotest/neotest-python

ENOENT: no such file or directory on win10 platform

Open
#99 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

Neovim v0.11.0 on windows 10 platform.

"No test found" after running Neotest run. When I tried lua neotest.run.run(), or lua neotest.run.run(vim.fn.getcwd()), error occured.
E5108: Error executing lua [string ":lua"]:1: attempt to index global 'neotest' (a nil value)
stack traceback:
[string ":lua"]:1: in main chunk

Then I try: Neotest summary it shows a blank window, and tests showed if I switch buffer to {project_root}\tests\unit\test_date.py. Where the ${project_root} is also my cwd. After hitting "r" key, red cross showed but no further information.

Image

The neotest.log file is blank within the whole above process under the config below :

{ 
	"nvim-neotest/neotest",
	dependencies = {
		"nvim-neotest/nvim-nio",
		"nvim-lua/plenary.nvim",
		"antoinemadec/FixCursorHold.nvim",
		"nvim-treesitter/nvim-treesitter",
		"nvim-neotest/neotest-python",
	},
	config = function()
		require("neotest").setup({
			adapters = {
				require("neotest-python")({
					dap = { justMyCode = false },
                                        runner = "pytest",
				}),
			},
		})
	end,
}

if I remove the runner = "pytest", The neotest.log file shows:
ERROR | 2025-05-13T10:19:08Z+0800 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:309 | Couldn't find positions in path C:\yss\coding\python\barra_client\tests\unit\test_date.py .../nvim-data/lazy/neotest/lua/neotest/lib/process/init.lua:41: ENOENT: no such file or directory
stack traceback:
[C]: in function 'error'
.../nvim-data/lazy/neotest/lua/neotest/lib/process/init.lua:41: in function 'run'
...vim-data/lazy/neotest-python/lua/neotest-python/base.lua:17: in function 'module_exists'
...vim-data/lazy/neotest-python/lua/neotest-python/base.lua:155: in function 'get_runner'
...-data/lazy/neotest-python/lua/neotest-python/adapter.lua:65: in function 'discover_positions'
...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:300: in function <...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:264>
[C]: in function 'xpcall'
...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:264: in function '_update_positions'
...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:317: in function <...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:315>
ERROR | 2025-05-13T10:19:08Z+0800 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:309 | Couldn't find positions in path C:\yss\coding\python\barra_client\tests\unit\test_date.py .../nvim-data/lazy/neotest/lua/neotest/lib/process/init.lua:41: ENOENT: no such file or directory

neotest-java simlar issue#135

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 Windows 10 configuration and inspect the ENOENT path through neotest-python/lua/neotest-python/base.lua, adapter.lua, and neotest/lua/neotest/lib/process/init.lua. Start with the logged failure during position discovery; done means the test file is discovered and can run without the ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim, python
Domain
devtools, operating-systems, testing-qa
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.