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.2.tar.gz (2.5 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.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_dryrun-1.0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_dryrun-1.0.2.tar.gz
Algorithm Hash digest
SHA256 165b9579572513e2b2e73d5978867bc59ffb6bcb37d4ca0d1abb09c2ff978461
MD5 92661f1ec431bc9a604b6ae70278011c
BLAKE2b-256 914445dab2f7a12d0ec5e794abde028a56e9e95b4a1aa1a113d7bfee8fdac1e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_dryrun-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_dryrun-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a916313e4e09e2ec0f9f298ff5a71b5fd728335d55342357aaab8c4472dadb1
MD5 5bd89b35e1abc917279de99b92efa90a
BLAKE2b-256 9cc449d42c9f53d5adef1cec263eebf557302d7b8428875ca893ada670363f1d

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