Skip to main content

A CLI tool that helps you quickly navigate to test functions in pytest files.

Project description

TestJump (TJ)

A CLI tool that helps you quickly navigate to test functions in pytest files.

When making fundamental changes to a project, multiple test cases often fail. Instead of manually opening files and searching for each failing test, TestJump allows you to jump directly to the test location 🤷.

Installation

Install this tool using pip:

pip install testjump

Or using pipx:

pipx install testjump

Or using uv:

uv tool install testjump

Usage

  1. Jump to a test function:
tj tests/test_calculator.py::test_addition
  1. Jump to a test class method:
tj tests/test_user.py::TestUser::test_user_creation

Interactive Usage with Multiple Files

You can use it interactively with a file containing multiple jump points:

for line in $(cat jumppoints.txt); do tj $line; echo "Press any key to continue..."; read; done

Output Options

TestJump supports different output formats:

  1. Print location only (useful for scripting):
tj -print tests/test_calculator.py::test_addition
# Output: tests/test_calculator.py:42
  1. JSON output with detailed information:
tj -json tests/test_calculator.py::test_addition
# Output:
# {
#   "status": "ok",
#   "path": "tests/test_calculator.py",
#   "class_name": null,
#   "function_name": "test_addition"
# }

Configuring Your Editor

TestJump uses VS Code by default, but you can configure your preferred editor by setting the TJ_EDITOR environment variable:

# For VS Code (default)
export TJ_EDITOR=vscode

# For Vim
export TJ_EDITOR=vim

# For IntelliJ IDEA
export TJ_EDITOR=idea

# For PyCharm
export TJ_EDITOR=pycharm

# For Neovim
export TJ_EDITOR=nvim

Add this to your .bashrc or .zshrc to make it permanent.

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

testjump-0.1.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testjump-0.1.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file testjump-0.1.4.tar.gz.

File metadata

  • Download URL: testjump-0.1.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for testjump-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5b4c3fc496fdcfa17fd75aa242096b59cebd52b01992f66aba0071b5cefb0b3c
MD5 85353d1779fedd05413207165d7c7bf0
BLAKE2b-256 51654fa73742e7a1d152ec15e1f24467d613b1d1097ef390e210cdb46e5609fd

See more details on using hashes here.

File details

Details for the file testjump-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: testjump-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for testjump-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b5b67cf6675b1eb5d3dfee431a2d3f9412da7f220fb6b1582641ce774c425d2a
MD5 f507dd48643d58f187c8c43514170f66
BLAKE2b-256 3ed1b5a94e49cb93a0e184422359eeac472264446e4e9b92934727f772632a41

See more details on using hashes here.

Supported by

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