Skip to content

sidmitra/testfinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testfinder - Find tests easier

Command-line tool to find, print all the test cases in a project.

  • Find your test methods, class names faster.
  • Integrate with other search/filtering/autocomplete tools like bash, grep, fzf.
  • Defaults to pytest test invocation syntax. -- Other invocation syntax like Django coming soon!

Install

pip install testfinder

Usage

cd <project-root>
testfinder

with fzf

fzf is an interactive Unix filter for command-line that can be used with any list and supports fuzzy searches.

  • Install fzf

  • Run pytest and find your test

pytest $(testfinder | fzf)

asciicast

How does it work?

In Python the files containing tests usually have the following naming conventions:

  • tests.py
  • test_*.py
  • *_test.py
  • tests/__init__.py

It enumerates all the files above, and discovers all the test cases in those files with a few simple regexes.

About

Enumerate all test cases in a Python project, filter, search using your own preferred tools like grep, fzf.

Topics

Resources

License

Stars

Watchers

Forks

Languages