Skip to content

ENOENT: no such file or directory on win10 platform #99

@ilovevim

Description

@ilovevim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions