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

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, which is helpful for ensuring type-safety.

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.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

pytest_dryrun-1.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_dryrun-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1017-azure

File hashes

Hashes for pytest_dryrun-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3a37b6f0a31847a3088b5a03e12c49eba9fc97cd3637097064b227da76a08750
MD5 d9105050cbb4656efa66abae7ef0a403
BLAKE2b-256 713f900e5753bb4684eb1fe50950b025ea2352837404be2fbe8b6e79da44d3df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_dryrun-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1017-azure

File hashes

Hashes for pytest_dryrun-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 139863e29d1420465bf298effa33744dbbb82d3049d131d514796ebfbe1c55e4
MD5 e826dc16375ae03471e283747fb4f895
BLAKE2b-256 0eb5ba03a11ed26f717f14267b4d5c805507d27743121df2d69cc471192e717a

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