Skip to main content

A Pytest plugin to ignore tests during collection without reporting them in the test summary.

Project description

Pytest Dryrun Plugin

A Pytest plugin to ignore tests during collection without reporting them in the test summary.

Installation

With Pip

$ pip install pytest-dryrun
Successfully installed pytest-dryrun-0.1.0

Usage

When the --dryrun flag is passed to Pytest, only tests marked with dryrun will be collected and run.

@pytest.mark.dryrun
def test_thing_one():
    """This test will be run, even during dryruns"""
    box = get_box()
    assert "thing one" in box

def test_thing_two():
    """This test will not by run if the `--dryrun` flag is given to Pytest"""
    box = get_box()
    assert "thing two" in box

Tests can also be marked with dryrun using the library's export:

from pytest_dryrun import dryrun

@dryrun
def test_thing_one():
    box = get_box()
    assert "thing one" in box

If the --no-dryrun flag is given, only tests not marked with dryrun will be collected, meaning that in the example above, only test_thing_two will be run.

The --dryrun and --no-dryrun arguments are mutually-exclusive.

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_dryrun-1.0.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

pytest_dryrun-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest_dryrun-1.0.0.tar.gz.

File metadata

  • Download URL: pytest_dryrun-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for pytest_dryrun-1.0.0.tar.gz
Algorithm Hash digest
SHA256 093be4fc3cb37f6b8bfa0bad3f27640fde404d24fb33ad2c952640e4ed676e57
MD5 7006a053656a6e3586b1b513a0866680
BLAKE2b-256 1b6efeed1f2825bd0136a0c437a0d673f16f35c1bd25875e6f8a47ee80d4caec

See more details on using hashes here.

File details

Details for the file pytest_dryrun-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_dryrun-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for pytest_dryrun-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fba6366e65e8a57395c20ef71913851059b33d697b83d3263fef5dbb4f965a0
MD5 3f573d5dcb172ee802d32511a471afad
BLAKE2b-256 49f78f948152bce037f590e1b369d46cf245c34825a95032324dca3cc5de5190

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page