pytest-skip-slow

0.0.5 · active · verified Thu Apr 16

pytest-skip-slow is a pytest plugin that enhances test execution by allowing users to mark tests as 'slow'. By default, tests marked with `@pytest.mark.slow` are skipped, helping maintain a fast local development feedback loop. These slow tests can then be explicitly included using the `--slow` command-line option. The current version is 0.0.5, released in February 2023, indicating a mature but infrequently updated project.

Common errors

Warnings

Install

Imports

Quickstart

Mark your long-running tests with `@pytest.mark.slow`. By default, `pytest` will skip these tests after the plugin is installed. To include and run these slow tests, use the `--slow` command-line option. To run only slow tests, combine with the marker expression `-m slow`.

import pytest
import time

def test_fast_calculation():
    assert 1 + 1 == 2

@pytest.mark.slow
def test_long_running_process():
    time.sleep(2) # Simulate a slow operation
    assert True

# To run fast tests (skipping slow by default):
# $ pytest

# To include slow tests:
# $ pytest --slow

# To run ONLY slow tests:
# $ pytest -m slow --slow

view raw JSON →