You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pytest-skip-slow

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pytest-skip-slow

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

0.0.5
pipPyPI
Maintainers
1

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 ====================

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts