nvim-neotest / nvim-neotest/neotest-python

neotest-python not respecting pytest.ini testpaths

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

Hello, I've just started using neotest and neotest-python, so apologies if the solution to my problem is answered somewhere else.

I have a project which uses pytest, and I have a pytest.ini file which specifies:

testpaths = tests/unit

The project also has some other directories with tests in them which should not be run with pytest. when I run pytest using CLI, it only runs tests within tests/unit as expected.

However when using neotest-python in neotest, it discovers all tests in the project, not just one the ones in tests/unit. Is this behaviour possible to achieve?

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 comparing pytest CLI discovery with neotest-python discovery for the pytest.ini file containing testpaths = tests/unit. Trace how the plugin discovers tests and determine where that configuration is or is not considered. Done means discovery includes only tests under tests/unit, matching pytest CLI behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.