Skip to main content

pytest-autofocus

Auto-focus plugin for pytest: run only @pytest.mark.focus tests when --auto-focus is set, otherwise run all tests.

Installation

pip install pytest-autofocus

Usage

Mark tests with @pytest.mark.focus:

import pytest

def test_normal():
    pass

@pytest.mark.focus
def test_focused():
    pass

Run with --auto-focus to run only focused tests (if any exist), otherwise run all tests:

pytest --auto-focus

If no tests are marked with @pytest.mark.focus, all tests run normally.

Run without --auto-focus to run all tests:

pytest

pytest-watcher Integration

Use with pytest-watcher for automatic test filtering:

ptw . -- --auto-focus

Requirements

  • Python 3.10+
  • pytest 7.0+

Metadata

Release files for pytest-autofocus 0.1.2

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

Source distribution (sdist)

Source distribution for pytest-autofocus 0.1.2
File Size Uploaded
pytest_autofocus-0.1.2.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-autofocus 0.1.2
File Interpreter ABI Platform
pytest_autofocus-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / pytest_autofocus-0.1.2.tar.gz

Download URL pytest_autofocus-0.1.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
86ce65a1cd253c6d69bfc125ee145e1e0fb0662bf8972928530c837bb4c49bb2
BLAKE2b-256 checksum
How to use checksums
405e35e28a1b13b0a18da585482f72797ff023eecbdeba5159a8c6dcbe23a331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / pytest_autofocus-0.1.2-py3-none-any.whl

Download URL pytest_autofocus-0.1.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2c19b7514dc009f9eef8f9675d8e3cd5d22b4e4f744956ad84d977b222723e5
BLAKE2b-256 checksum
How to use checksums
63bb37231ea55481324e9b343a8dc3c476e6d7d3d2fa2b0c0f8eabef25b4a6a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.2 This release

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