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:

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.0.tar.gz (5.3 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.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_autofocus-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 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.0.tar.gz
Algorithm Hash digest
SHA256 94e56c99d3f944abf9176ff3df9acae77b4faaaf0f69776d760e4000ce07461b
MD5 b169e783d814353bc8d557b1bc5a566c
BLAKE2b-256 0db601d01c25bba55e93d9b1b9de8bce2473c0ac823d8c8f1b9d95d610c912b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_autofocus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd43c7a5f1bc19ce200a03f120f11fe488f28e4798bc04f0cecc2aa5f201d8d1
MD5 8c9690d89f7eb40f6eff2d7e631a5ec5
BLAKE2b-256 211347e688684a87fc9f9bc52f4bc7f957e833f6eca2e8728c9d533f18047794

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