nvim-neotest / nvim-neotest/neotest-python

Possible to just run pytest on open buffer without modifying is_test_file?

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

If I have a python file like foo.py that does not end or start with test_ but contains test methods that start with test_, is there a way to just run pytest on the current buffer, like what !pytest "%" would do basically, but via Neotest. I understand I could provide my own is_test_file function that scans python files for test_ method but wondering if there is a way to force Neotest to consider the active buffer a test file and just run pytest on it on an as-needed basis.

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 tracing how neotest-python identifies test files and how Neotest runs the current buffer. Check whether an existing buffer-level or adapter-level entry point can bypass is_test_file, then verify the behavior with a Python buffer named foo.py containing test_ methods; done means the buffer runs through pytest without changing file detection.

Written by the indexing model from the issue text.

Assessment

Tech stack
neovim, python
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.