Skip to main content

A pytest plugin to skip `@pytest.mark.slow` tests by default.

Project description

pytest-skip-slow

A pytest plugin to skip @pytest.mark.slow tests by default. Include the slow tests with --slow.

Installation

$ pip install pytest-skip-slow

Usage

Example test_slow.py:

import pytest

def test_normal():
    pass

@pytest.mark.slow
def test_slow():
    pass

Normal pytest sessions skip slow tests:

(venv) $ pytest -v test_slow.py
========================= test session starts ==========================
collected 2 items                                                      

test_slow.py::test_normal PASSED                                 [ 50%]
test_slow.py::test_slow SKIPPED (need --slow option to run)      [100%]

===================== 1 passed, 1 skipped in 0.00s =====================

Include the slow tests with --slow:

(venv) $ pytest -v --slow test_slow.py
========================= test session starts ==========================
collected 2 items                                                      

test_slow.py::test_normal PASSED                                 [ 50%]
test_slow.py::test_slow PASSED                                   [100%]

========================== 2 passed in 0.00s ===========================

Run only the slow tests with -m slow --slow:

(venv) $ pytest -v -m slow --slow test_slow.py 
========================= test session starts ==========================
collected 2 items / 1 deselected / 1 selected                          

test_slow.py::test_slow PASSED                                   [100%]

=================== 1 passed, 1 deselected in 0.00s ====================

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_skip_slow-1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

pytest_skip_slow-1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest_skip_slow-1.0.tar.gz.

File metadata

  • Download URL: pytest_skip_slow-1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pytest_skip_slow-1.0.tar.gz
Algorithm Hash digest
SHA256 a5ae9565467f2c178b8348e6cd8fda932cff7534c2ecfaab32bb53a5ff8264eb
MD5 44324a6e6d33e558e0cff5059db53ffb
BLAKE2b-256 b29df9326d7e072dcb8a240793e41551baae5ad9693141dcead2b253402459ef

See more details on using hashes here.

File details

Details for the file pytest_skip_slow-1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_skip_slow-1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pytest_skip_slow-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 390fac78c75b61057ad5147db9d73871c295f925a19a33f543fdb090ac02c30d
MD5 cd99e2a315215ff5537831b75112f79e
BLAKE2b-256 0c8fcf0c0ac67949e35c57d26a0d22a6be395a614afb3019a7bdb936b690bc8a

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