Skip to main content

Find test cases on a Python project.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testfinder-0.0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

testfinder-0.0.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page