Skip to main content

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

Project description

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+

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

pytest_autofocus-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

pytest_autofocus-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest_autofocus-0.1.1.tar.gz.

File metadata

  • Download URL: pytest_autofocus-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pytest_autofocus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d0110a86c341705eb05bf96335b40d23b6ed53abb09524327ccd894c598fc4f7
MD5 05757f03aa8b8ab8b0a0bba1a7056e8e
BLAKE2b-256 c1ad13103d33cd9bc3496840749afc5bb5e37f13535fbb2d267de776990cf5f2

See more details on using hashes here.

File details

Details for the file pytest_autofocus-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_autofocus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc57ddd22ba7aab3771f64ec32cdb10858238d22c1f3c6c0793c96b375e2e894
MD5 3f25dc213e18591e9d80552519803f57
BLAKE2b-256 d16515f57229aec618386ae5397f0b0d6cd858ad24d4bcbf88bedd2f66955855

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