Skip to content

Path containing forward slash won't be splited on Windows when matching the file #107

@Xiaomony

Description

@Xiaomony

I'm on Windows, and the following problem doesn't occur on Ubuntu(wsl)

When I run tests in test_add.py or toggle tests summary, it shows that no tests found.

I've looked through the source code and modified base.lua in neotest-python

Image

Then I run tests again and got the following output:

Image

It seems that the adapter splits the file path by \, but my file path contains only /

Then I modified the source code, changing this line

local elems = vim.split(file_path, Path.path.sep)

into

local elems = vim.split(file_path, "/")

Then tests summary shows all the tests correctly.

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