Skip to main content

pytestquick

PyPI version Python versions CI Coverage License

A small command-line utility for quickly discovering and running pytest targets.

pytestquick discovers the pytest target you are most likely working on from the current working directory and delegates execution to pytest, with concise terminal coverage enabled by default.

It supports explicit test files, pytest node IDs, application directories, test classes, test methods, and—when no target is supplied—the most recently modified test file.

Coverage is intentionally part of the normal development loop. By default, pytestquick reports branch coverage and missing lines for the source scope associated with the selected test target.

It intentionally focuses on pytest target discovery and command construction. It does not replace pytest, introduce another test framework, or change how pytest executes your tests.

Installation

Install the latest release from PyPI:

pip install pytestquick

Or install it as an isolated command with uv:

uv tool install pytestquick

It can also be installed with pipx:

pipx install pytestquick

To install it directly into a project environment:

uv add --dev pytestquick

Commands

The primary command is:

pytestquick

For convenience, pyquicktest is also installed as an alias:

pyquicktest

Both commands are equivalent.

Quick example

Run pytestquick without a target to select the most recently modified test file beneath the current working directory:

$ pytestquick
✓ Latest modified test file
  tests/services/test_invoice.py

→ Running:
  /path/to/python -m pytest -rs tests/services/test_invoice.py --disable-warnings --cov=my_package --cov-branch --cov-report=term-missing

pytestquick reports the selected target, shows the exact command being run, prints branch coverage and missing lines in the terminal, and returns pytest's exit status unchanged.

Usage

Run the most recently modified test file with coverage:

pytestquick

Run all tests beneath an application or package directory with coverage:

pytestquick billing

Run a test class from the most recently modified test file:

pytestquick TestInvoice

Run a test method or function from the most recently modified test file:

pytestquick test_total

Run a specific test file:

pytestquick tests/test_models.py

Run an explicit pytest node:

pytestquick tests/test_models.py::TestInvoice::test_total

Forward normal pytest arguments:

pytestquick billing -vv -x

Collect and list tests:

pytestquick --list

Filter tests by keyword:

pytestquick --grep invoice

Coverage is enabled by default:

pytestquick
pytestquick billing

Run without coverage:

pytestquick --no-coverage
pytestquick billing --no-coverage

The explicit coverage option remains available:

pytestquick --coverage

Display the installed version:

pytestquick --version

How discovery works

The current working directory defines the search scope.

Running:

cd ~/Sites/project
pytestquick

searches beneath ~/Sites/project.

Running from a subdirectory intentionally limits discovery to that subtree:

cd ~/Sites/project/billing
pytestquick

pytestquick does not walk upward looking for a repository root, Git directory, or configuration file.

The directory where the command is run is the directory it searches.

A Python file is considered a test file when either:

  • its name begins with test_
  • it is located beneath a directory named tests

When multiple matching application directories exist, pytestquick prefers the shallowest one that contains tests.

Target resolution

Targets are interpreted in this order:

  1. An explicit pytest node or filesystem path
  2. A test method beginning with test_
  3. A test class beginning with Test
  4. An application or package directory
  5. The most recently modified test file when no target is supplied

Once a target is selected, pytestquick delegates execution to pytest.

Find the right test. Run it. See what it covers.

Let pytest do the rest.

Special options

List collected tests

pytestquick --list
pytestquick billing --list

This runs pytest with --collect-only. Coverage is not collected in list mode.

Filter by keyword

pytestquick --grep invoice
pytestquick billing --grep invoice

This translates to pytest's -k option and still reports coverage by default.

Coverage

Coverage is enabled by default.

pytestquick
pytestquick billing
pytestquick tests/test_models.py

pytestquick uses pytest-cov to report branch coverage and missing lines directly in the terminal.

The coverage scope is inferred from the selected test target. For example, a test beneath an application's tests directory reports coverage for that application rather than for the test file itself.

To run without coverage:

pytestquick --no-coverage
pytestquick billing --no-coverage

The explicit --coverage option remains supported:

pytestquick --coverage

Pytest arguments

Arguments not handled by pytestquick are passed directly to pytest.

pytestquick -vv
pytestquick -x
pytestquick billing -vv -x
pytestquick tests/test_models.py --tb=short

Exit statuses

pytestquick returns the exact exit status produced by pytest.

This means it behaves correctly in:

  • shell scripts
  • editor integrations
  • Docker containers
  • continuous-integration environments

Target-discovery failures return exit status 1.

Why?

Because this gets old:

pytest path/to/tests/test_really_long_filename.py::TestSomething::test_case

And this does not:

pytestquick test_case

Philosophy

pytestquick intentionally does one thing well.

It does not replace pytest.

It does not introduce another testing framework, configuration system, or plugin architecture.

It simply removes friction from running the test you are currently working on and seeing how much of the surrounding code that test exercises.

Development

Install the development environment:

uv sync --dev

Run the full test suite:

make test

Run formatting, linting, type checking, and tests:

make check

Run the complete release validation:

make release-check

License

pytestquick is released under the MIT License.

Metadata

Release files for pytestquick 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytestquick 0.1.3
File Size Uploaded
pytestquick-0.1.3.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytestquick 0.1.3
File Interpreter ABI Platform
pytestquick-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / pytestquick-0.1.3.tar.gz

Download URL pytestquick-0.1.3.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fc722bb477551f4583d8ad7cf22a2f4b88e8fdd5a6e3c08861ff3817d4df65c3
BLAKE2b-256 checksum
How to use checksums
657c22060e20061e1aaa5ad51d4fcc17de7fa8b1038331d0caa940d6dbbb189a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / pytestquick-0.1.3-py3-none-any.whl

Download URL pytestquick-0.1.3-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9710af08434f59923c41242dc497eef7d9aade54c27124f9672091768f620a91
BLAKE2b-256 checksum
How to use checksums
80b340da3f61b8250b7ff6e3c44c0ac74f4c2314cbe32b3918a6a93c3bcce65c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page