Skip to content

No tests found if running from a non-test file #40

Closed
@filipgodlewski

Description

@filipgodlewski

Hey, I know this might be self explanatory, but hear me out ;)

So let's say I have the following folder structure:

test_py
├── main.py
├── test_bar.py
└── test_foo.py

If I open either test_foo.py or test_bar.py and run :lua require'neotest'.summary.toggle(), it will successfully parse all tests (including the other not-opened-yet test files). I can then run the tests from the summary, all is totally fine.

The problem:
If I try to do the same from main.py (let's say that I don't have other buffers open yet), it will parse the tests forever ('Parsing tests'). If I close and reopen the summary, it will finally tell me that it could not find any tests. All is fixed again, if I open any test file, but as you can imagine, it is far from optimal :(

The question is, is it a bug, is it an enhancement request, or can it be solved with a better .is_test_file()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions