hatch icon indicating copy to clipboard operation
hatch copied to clipboard

`hatch test` tab completion

Open euclio opened this issue 3 weeks ago • 1 comments

Description

hatch test should support tab-completion for test file paths (and ideally test names).

Today, running hatch test <TAB> (in zsh) completes nothing. It should instead list the available test directories.

$ hatch test <TAB>
src tests

Ideally, we could be able to find test names within the test files as well, though this would be more difficult to implement:

$ hatch test -vv tests/test_foo.py::<TAB>
test_bar

Use case/motivation

It can be tedious to manually type out the path to a test file. I would like tab-completion to help me type it faster.

Related issues

No response

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

euclio avatar Dec 02 '25 21:12 euclio

Hatch uses click, both click and Pytest already support auto completion. Have you tried ensuring both are setup in your terminal correctly for autocompletion?

cjames23 avatar Dec 10 '25 07:12 cjames23