pytestquick
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 directly to pytest. 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.
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.
- PyPI: https://pypi.org/project/pytestquick/
- Source: https://github.com/fifoa-labs/pytestquick
- License: MIT
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
pytestquick reports the selected target, shows the exact command being run,
and returns pytest's exit status unchanged.
Usage
Run the most recently modified test file:
pytestquick
Run all tests beneath an application or package directory:
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
Run the selected tests through coverage:
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:
- An explicit pytest node or filesystem path
- A test method beginning with
test_ - A test class beginning with
Test - An application or package directory
- 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. Let pytest do the rest.
Special options
List collected tests
pytestquick --list
pytestquick billing --list
This runs pytest with --collect-only.
Filter by keyword
pytestquick --grep invoice
pytestquick billing --grep invoice
This translates to pytest's -k option.
Run with coverage
pytestquick --coverage
pytestquick billing --coverage
This runs the selected target through Python's coverage module.
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 or coverage.
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.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytestquick-0.1.1.tar.gz.
File metadata
- Download URL: pytestquick-0.1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1db156ac9c4e1ff606968cfc074f48e19fc818a7b35475c25c872300f727926b
|
|
| MD5 |
95b070c15e8ed900828284e281a6fac8
|
|
| BLAKE2b-256 |
2f3ccf52700e3445725747197a89b3cfd23959062e160f63464a8fdd9ee085fa
|
Provenance
The following attestation bundles were made for pytestquick-0.1.1.tar.gz:
Publisher:
publish.yml on fifoa-labs/pytestquick
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytestquick-0.1.1.tar.gz -
Subject digest:
1db156ac9c4e1ff606968cfc074f48e19fc818a7b35475c25c872300f727926b - Sigstore transparency entry: 2319654335
- Sigstore integration time:
-
Permalink:
fifoa-labs/pytestquick@aa8bf34dff1eb55b1b2b054412d6af0509132f2d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/fifoa-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa8bf34dff1eb55b1b2b054412d6af0509132f2d -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytestquick-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytestquick-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beade24ded6dfa3d47f79434409ea29ced793cd9791db39a7dc663d1df8da84f
|
|
| MD5 |
9e6e18723cf1ec92124a31eada233278
|
|
| BLAKE2b-256 |
cd269e2ceb29b19c94fda10ea1949a3e5d86e37c2353bde395fdc865d13f741e
|
Provenance
The following attestation bundles were made for pytestquick-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on fifoa-labs/pytestquick
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytestquick-0.1.1-py3-none-any.whl -
Subject digest:
beade24ded6dfa3d47f79434409ea29ced793cd9791db39a7dc663d1df8da84f - Sigstore transparency entry: 2319654396
- Sigstore integration time:
-
Permalink:
fifoa-labs/pytestquick@aa8bf34dff1eb55b1b2b054412d6af0509132f2d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/fifoa-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa8bf34dff1eb55b1b2b054412d6af0509132f2d -
Trigger Event:
release
-
Statement type: